-
-
Couldn't load subscription status.
- Fork 326
Description
Link to page
https://next-intl.dev/docs/workflows/typescript#messages-arguments
Describe the problem
Hi,
As of next@canary (since v15.5.1-canary.0), next dev, the way it is done in next-intl, won't generate createMessagesDeclaration. This is because the config is no longer loaded within next-dev, but within server-start.
next-intl/packages/next-intl/src/plugin/createMessagesDeclaration.tsx
Lines 17 to 23 in 1de05a2
| const shouldRun = [ | |
| 'dev', | |
| 'build', | |
| 'typegen' | |
| // Note: The 'lint' task doesn't consult the | |
| // Next.js config, so we can't detect it here. | |
| ].some((arg) => process.argv.includes(arg)); |
So the dev arg is no longer visible.
Just opening this issue to document this. I do believe next typegen is more correct to generate such types, but yeah, people only running next dev.
To verify:
pnpm create next-app -e https://github.com/amannn/next-intl/tree/main/examples/example-app-router next-intl-app-routerThen install next@canary, and see that the messages folder doesn't have the .d.json.ts file.