next-intl 3.19.0 → 3.19.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -24,6 +24,9 @@ function getDefaultTimeZoneImpl() {
24
24
  }
25
25
  const getDefaultTimeZone = React.cache(getDefaultTimeZoneImpl);
26
26
  async function receiveRuntimeConfigImpl(getConfig, localeOverride) {
27
+ if (typeof getConfig !== 'function') {
28
+ throw new Error("Invalid i18n request configuration detected.\n\nPlease verify that:\n1. In case you've specified a custom location in your Next.js config, make sure that the path is correct.\n2. You have a default export in your i18n request configuration file.\n\nSee also: https://next-intl-docs.vercel.app/docs/usage/configuration#i18n-request\n");
29
+ }
27
30
  let hasReadLocale = false;
28
31
 
29
32
  // In case the consumer doesn't read `params.locale` and instead provides the
@@ -1 +1 @@
1
- import{cache as t}from"react";import{_createIntlFormatters as e,_createCache as o,initializeConfig as n}from"use-intl/core";import{getRequestLocale as r}from"./RequestLocale.js";import a from"next-intl/config";const s=t((function(){return new Date}));const i=t((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const l=t((async function(t,e){let o=!1;const n={get locale(){return o=!0,e||r()}};let a=t(n);return a instanceof Promise&&(a=await a),o?a.locale&&console.error("\nYou've read the `locale` param that was passed to `getRequestConfig` but have also returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"):a.locale||console.error("\nYou haven't read the `locale` param that was passed to `getRequestConfig` and also haven't returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"),{...a,locale:a.locale||n.locale,now:a.now||s(),timeZone:a.timeZone||i()}})),c=t(e),u=t(o);const p=t((async function(t){const e=await l(a,t);return{...n(e),_formatters:c(u())}}));export{p as default};
1
+ import{cache as e}from"react";import{_createIntlFormatters as t,_createCache as o,initializeConfig as n}from"use-intl/core";import{getRequestLocale as r}from"./RequestLocale.js";import a from"next-intl/config";const i=e((function(){return new Date}));const s=e((function(){return Intl.DateTimeFormat().resolvedOptions().timeZone}));const c=e((async function(e,t){if("function"!=typeof e)throw new Error("Invalid i18n request configuration detected.\n\nPlease verify that:\n1. In case you've specified a custom location in your Next.js config, make sure that the path is correct.\n2. You have a default export in your i18n request configuration file.\n\nSee also: https://next-intl-docs.vercel.app/docs/usage/configuration#i18n-request\n");let o=!1;const n={get locale(){return o=!0,t||r()}};let a=e(n);return a instanceof Promise&&(a=await a),o?a.locale&&console.error("\nYou've read the `locale` param that was passed to `getRequestConfig` but have also returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"):a.locale||console.error("\nYou haven't read the `locale` param that was passed to `getRequestConfig` and also haven't returned one from the function. This is likely an error, please ensure that you're consistently using a setup with or without i18n routing: https://next-intl-docs.vercel.app/docs/getting-started/app-router\n"),{...a,locale:a.locale||n.locale,now:a.now||i(),timeZone:a.timeZone||s()}})),u=e(t),l=e(o);const p=e((async function(e){const t=await c(a,e);return{...n(t),_formatters:u(l())}}));export{p as default};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "next-intl",
3
- "version": "3.19.0",
3
+ "version": "3.19.1",
4
4
  "sideEffects": false,
5
5
  "author": "Jan Amann <jan@amann.work>",
6
6
  "funding": [
@@ -87,11 +87,11 @@
87
87
  "dependencies": {
88
88
  "@formatjs/intl-localematcher": "^0.5.4",
89
89
  "negotiator": "^0.6.3",
90
- "use-intl": "^3.19.0"
90
+ "use-intl": "^3.19.1"
91
91
  },
92
92
  "peerDependencies": {
93
93
  "next": "^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
94
94
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0"
95
95
  },
96
- "gitHead": "241c3ea2b0c7c8444b76518e0a3a2979aa208497"
96
+ "gitHead": "43b268e5ae8ce2897ff362f58a9ad45cd49e44dd"
97
97
  }