Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.0.0-beta.13 message-compiler inaccessible in production #2208

Closed
Ingramz opened this issue Jul 7, 2023 · 0 comments · Fixed by #2214
Closed

8.0.0-beta.13 message-compiler inaccessible in production #2208

Ingramz opened this issue Jul 7, 2023 · 0 comments · Fixed by #2214
Labels

Comments

@Ingramz
Copy link

Ingramz commented Jul 7, 2023

Environment

N/A

Reproduction

https://stackblitz.com/edit/github-ec6imb

Click on the link to go to the server route. Works in dev mode.

Cancel process and run npm run build && npm run preview to see production mode.

Click on link again. Fails.

Describe the bug

In previous versions I had created a server route that compiled messages using generateJSON from @intlify/bundle-utils. This worked well up until 8.0.0-beta.13.

Now there seems to be an issue importing message-compiler, because it tries to load cjs version but the server bundle only contains esm module.

Manually patching the included bundle-utils to use import syntax instead of require works:
https://github.com/intlify/bundle-tools/blob/ae09d0a7c409ffbdfad0fc25f2a54968f8bde4b9/packages/bundle-utils/src/codegen.ts#L17-L23

Also few other observations:

  • LocationStub is renamed to LOCATION_STUB, so I think this import is currently broken.
  • dependencies of bundle-utils are beta.20 but other i18n related dependencies are beta.22, I am guessing that mismatch is not intended?

Additional context

No response

Logs

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants