deploy: v0.12 fix 存档key名

This commit is contained in:
2026-06-24 03:09:02 +00:00
parent 7a08d49fe3
commit e0a5281119
58743 changed files with 7297269 additions and 39505 deletions
+21
View File
@@ -0,0 +1,21 @@
import getConfig from '../server/react-server/getConfig.js';
import use from '../shared/use.js';
function useHook(hookName, promise) {
try {
return use(promise);
} catch (error) {
if (error instanceof TypeError && error.message.includes("Cannot read properties of null (reading 'use')")) {
throw new Error(`\`${hookName}\` is not callable within an async component. Please refer to https://next-intl.dev/docs/environments/server-client-components#async-components`, {
cause: error
});
} else {
throw error;
}
}
}
function useConfig(hookName) {
return useHook(hookName, getConfig());
}
export { useConfig as default };