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

print/nuxt.config.js: optimize dayjs deps to avoid console error in dev mode #4107

Merged

Conversation

BacLuc
Copy link
Contributor

@BacLuc BacLuc commented Nov 13, 2023

Dayjs seems to be distributed as commonjs module.
This is no problem in production mode and production preview. But in dev mode, the modules are not transformed by vite and the browser cannot work with the commonjs modules. This fixes the following console error for customParseFormat (and the corresponding erros for the other dayjs plugins): '/print/_nuxt/node_modules/dayjs/plugin/customParseFormat.js?v=6041f242' does not provide an export named 'default'

…ev mode

Dayjs seems to be distributed as commonjs module.
This is no problem in production mode and production preview.
But in dev mode, the modules are not transformed by vite
and the browser cannot work with the commonjs modules.
This fixes the following console error for customParseFormat
(and the corresponding erros for the other dayjs plugins):
'/print/_nuxt/node_modules/dayjs/plugin/customParseFormat.js?v=6041f242' does not provide an export named 'default'
Copy link
Member

@manuelmeister manuelmeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I this the recommended way?

@manuelmeister manuelmeister added this pull request to the merge queue Dec 5, 2023
Merged via the queue into ecamp:devel with commit 98fa4c5 Dec 5, 2023
28 checks passed
@BacLuc BacLuc deleted the print-transform-dayjs-in-dev-mode branch December 23, 2023 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants