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

The CJS build of Vite's Node API is deprecated #675

Open
6 tasks done
throrin19 opened this issue Feb 6, 2024 · 1 comment
Open
6 tasks done

The CJS build of Vite's Node API is deprecated #675

throrin19 opened this issue Feb 6, 2024 · 1 comment
Labels
to triage This issue needs to be triaged

Comments

@throrin19
Copy link

throrin19 commented Feb 6, 2024

Describe the bug

Hello, I migrate all my project to pure ESM, vite part works fine without any warn about CJS but when I try to launch histoire, I have this warn :

The CJS build of Vite's Node API is deprecated. See https://vitejs.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.

How to avoid this warn and force histoire to use ESM only ?

Reproduction

  • launch histoire with vite 5.x+

System Info

System:
    OS: macOS 13.6.4
    CPU: (8) x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Memory: 4.44 GB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.11.0 - ~/.nvm/versions/node/v20.11.0/bin/node
    npm: 10.2.4 - ~/.nvm/versions/node/v20.11.0/bin/npm
    pnpm: 7.30.0 - /usr/local/bin/pnpm
  Browsers:
    Chrome: 121.0.6167.139
    Edge: 121.0.2277.98
    Safari: 17.3
  npmPackages:
    @histoire/controls: 0.17.9 => 0.17.9 
    @histoire/plugin-vue: 0.17.9 => 0.17.9 
    @vitejs/plugin-vue: 5.0.3 => 5.0.3 
    histoire: 0.17.9 => 0.17.9 
    vite: 5.0.12 => 5.0.12 

Used Package Manager

npm

Validations

@throrin19 throrin19 added the to triage This issue needs to be triaged label Feb 6, 2024
@idlethumbs
Copy link

idlethumbs commented Apr 8, 2024

+ 1
I'm using nuxt and can no longer build stories getting an error while using vue-imask:

Error [ERR_UNSUPPORTED_DIR_IMPORT]: Directory import '/Users/amonjafarbay/projects/gospace/ui/base-app/node_modules/vue-imask/esm' is not supported resolving ES modules imported from /Users/amonjafarbay/projects/gospace/ui/base-app/node_modules/vite-node/dist/client.mjs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
to triage This issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

2 participants