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

A new update is breaking bundling of SSR application #61

Closed
sionzee opened this issue Mar 22, 2022 · 2 comments
Closed

A new update is breaking bundling of SSR application #61

sionzee opened this issue Mar 22, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@sionzee
Copy link

sionzee commented Mar 22, 2022

Hello,

on update to 1.0.0 the DTS is breaking bundling of chalk,

failed to load config from /home/sionzee/projects/censured/editor/packages/editor/vite.config.ts
error when starting dev server:
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/sionzee/projects/censured/editor/node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/index.js from /home/sionzee/projects/censured/editor/node_modules/.pnpm/vite-plugin-dts@1.0.0_vite@2.8.6/node_modules/vite-plugin-dts/dist/index.js not supported.
Instead change the require of /home/sionzee/projects/censured/editor/node_modules/.pnpm/chalk@5.0.1/node_modules/chalk/source/index.js in /home/sionzee/projects/censured/editor/node_modules/.pnpm/vite-plugin-dts@1.0.0_vite@2.8.6/node_modules/vite-plugin-dts/dist/index.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/home/sionzee/projects/censured/editor/node_modules/.pnpm/vite-plugin-dts@1.0.0_vite@2.8.6/node_modules/vite-plugin-dts/dist/index.js:34:28)
    at async Promise.all (index 0)
    at async loadConfigFromFile (/home/sionzee/projects/censured/editor/node_modules/.pnpm/vite@2.8.6/node_modules/vite/dist/node/chunks/dep-9c153816.js:71326:31)
    at async resolveConfig (/home/sionzee/projects/censured/editor/node_modules/.pnpm/vite@2.8.6/node_modules/vite/dist/node/chunks/dep-9c153816.js:70873:28)
    at async createServer (/home/sionzee/projects/censured/editor/node_modules/.pnpm/vite@2.8.6/node_modules/vite/dist/node/chunks/dep-9c153816.js:56425:20)
    at async CAC.<anonymous> (/home/sionzee/projects/censured/editor/node_modules/.pnpm/vite@2.8.6/node_modules/vite/dist/node/cli.js:688:24)
undefined

Returning back to ^0.9.10 fixes the error.


This looks like an include issue, because it is visiting node_modules of other packages in monorepo.
I'm using chalk in package where vite-plugin-dts is not included.

In the config I have:

    plugins: [
      dts({
        include: ['./index.ts', './src'],
      })
    ],

Unfortunately I cannot provide source code due NDA.

@qmhc qmhc added the bug Something isn't working label Mar 22, 2022
@qmhc
Copy link
Owner

qmhc commented Mar 22, 2022

Fix it with ab7960f

@qmhc qmhc closed this as completed Mar 22, 2022
@sionzee
Copy link
Author

sionzee commented Mar 22, 2022

I was just testing it and it works! 🎉 Thank you for quick fix.

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

No branches or pull requests

2 participants