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

vite-plugin-checker crashes the build when running in CommonJS #277

Open
2 tasks done
stereokai opened this issue Sep 5, 2023 · 1 comment
Open
2 tasks done

vite-plugin-checker crashes the build when running in CommonJS #277

stereokai opened this issue Sep 5, 2023 · 1 comment

Comments

@stereokai
Copy link

Describe the bug

This line crashes the build.

The line (const { createServeAndBuild } = await import(`./checkers/${name}/main.js\`)) appears exactly like that in the CJS build. As soon as this line is executed, the whole process tree just explodes and quits. (Is it uncompiled? Doesn't Node.js in CJS mode not support await import()? Or am I outdated?)

Reproduction

Using Node 20.2.0, use any Vite version with the repo configured as CommonJS (no "type": "module"in package.json)

Expected behavior

Build runs to completion.

System Info

System:
    OS: macOS 11.7.8
    CPU: (8) x64 Intel(R) Core(TM) i7-4850HQ CPU @ 2.30GHz
    Memory: 39.02 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 20.2.0 - /Users/~/.nvm/versions/node/v20.2.0/bin/node
    npm: 9.6.6 - /Users/~/.nvm/versions/node/v20.2.0/bin/npm
  Browsers:
    Chrome: 116.0.5845.140
    Safari: 16.5.2
  npmPackages:
    vite-plugin-checker: ~0.6.1 => 0.6.2

Additional context

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@IgorLav
Copy link

IgorLav commented Sep 8, 2023

@stereokai I've experienced the same issue on node 14,18,1. Didn't find the way to fix it.
Any updates on this issue?

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