Skip to content

[Docs]: createMessagesDeclaration on next dev won't output anymore #2006

@icyJoseph

Description

@icyJoseph

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.

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-router

Then install next@canary, and see that the messages folder doesn't have the .d.json.ts file.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationunconfirmedNeeds triage.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions