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

Error: Dynamic require of "path" is not supported #405

Closed
piotr-cz opened this issue Nov 4, 2022 · 6 comments · Fixed by #406
Closed

Error: Dynamic require of "path" is not supported #405

piotr-cz opened this issue Nov 4, 2022 · 6 comments · Fixed by #406
Assignees
Labels
bug Something isn't working

Comments

@piotr-cz
Copy link

piotr-cz commented Nov 4, 2022

After updating to v0.13.2 this errors stops the build (tsc && vite build) on node v16.18.0:

error during build:
Error: Dynamic require of "path" is not supported
    at file:///xxxx/node_modules/vite-plugin-pwa/dist/chunk-22M6QDW2.mjs:12:9
    at node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/lib/picomatch.js (file:///xxx/node_modules/vite-plugin-pwa/dist/rollup-plugin-replace.es-E5RG33HN.mjs:1316:16)
    at __require2 (file:///xxx/node_modules/vite-plugin-pwa/dist/chunk-22M6QDW2.mjs:15:50)
    at node_modules/.pnpm/picomatch@2.3.1/node_modules/picomatch/index.js (file:///xxx/node_modules/vite-plugin-pwa/dist/rollup-plugin-replace.es-E5RG33HN.mjs:1460:22)
...

When I change "type"="module" to "commonjs" in package.json, error goes away

Related vite issues I found:

Suspect PR:

@thovden
Copy link

thovden commented Nov 4, 2022

Also got this with 0.13.2 while building with vite. 0.13.1 works fine.

@userquin userquin added the bug Something isn't working label Nov 4, 2022
@userquin userquin self-assigned this Nov 4, 2022
@laurentpayot
Copy link

Same here. I had to revert to 0.13.1.

@sharmapukar217
Copy link

Same here. I had to revert to 0.13.1.

I am having same issue even with 0.13.1

@userquin
Copy link
Member

userquin commented Nov 7, 2022

shoud be fixed with v0.13.3

@piotr-cz
Copy link
Author

piotr-cz commented Nov 7, 2022

Thanks!
update to 0.13.3 fixed the problem for me

@laurentpayot
Copy link

Thanks! Working now with v0.13.3 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants