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

Backward compatible CJS default export #110

Closed
fadedhero opened this issue Oct 24, 2023 · 1 comment
Closed

Backward compatible CJS default export #110

fadedhero opened this issue Oct 24, 2023 · 1 comment

Comments

@fadedhero
Copy link

Environment

node v18.17.1
defu v.6.1.2
nuxt 2.17.2

Reproduction

Any Nuxt2 project above version 2.17.1

Describe the bug

With Nuxt v2.17.1 the package webpack-dev-middleware has been pinned to "5.0.0". This has a peer dependency of webpack ^5.0.0.

With webpack5 comes named imports. I can see in version 6.0.0 that you switched to named imports. Apparantly there is still an issue in this package with named imports.

This is the error message I get in the console, when I start a nuxt2 project: defu_WEBPACK_IMPORTED_MODULE_3__ is not a function.

Which means there is still an import type error in the newer version.

Additional context

This seems not to happen however when I start the project in PS, but only through a cmd

Logs

No response

@pi0 pi0 changed the title Webpack5 named imports error Backward compatible CJS default export Oct 24, 2023
@pi0
Copy link
Member

pi0 commented Oct 24, 2023

Hi. If you would like to help on adding backward CJS compatibility, we need to create an entry like this: https://github.com/unjs/destr/blob/main/lib/index.cjs

If it is clear enough how to do it, feel free to make a PR 👍🏼 fixed in 3c8c880

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

No branches or pull requests

2 participants