withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.65k stars 2.48k forks source link

🐛 BUG: Astro cannot find module `snowpack-plugin-jsx.cjs` #808

Closed leonardopliski closed 3 years ago

leonardopliski commented 3 years ago

What package manager are you using?

npm

What operating system are you using?

Linux

Describe the Bug

When I run npm run start Astro throws an error that it cannot find the module snowpack-plugin-jsx.cjs, but when debugging I found out that the filename is actually inside the Astro node_modules package, but the filename is just snowpack-plugin.cjs:

Package versions:

"devDependencies": {
    "astro": "^0.18.0-next.3",
    "@astrojs/renderer-preact": "^0.2.0-next.0"
}

Node version: v16.5.0

In the previous version, it was working as expected.

Steps to Reproduce

  1. npm init astro using template blog
  2. npm install
  3. npm run start
  4. The Error:
    Error: Cannot find module '/home/leonardo/projects/test/node_modules/astro/snowpack-plugin-jsx.cjs'
    Require stack:
    - /home/leonardo/projects/test/node_modules/snowpack/lib/cjs/util.js
    - /home/leonardo/projects/test/node_modules/snowpack/lib/cjs/commands/add-rm.js
    - /home/leonardo/projects/test/node_modules/snowpack/lib/cjs/index.js
    ...

What is expected: The filename should be resolved and no error is thrown.

Link to Minimal Reproducible Example

https://github.com/leonardopliski/astro-bug-reproducible-app

FredKSchott commented 3 years ago

Thanks for filing! This was a next release that wasn't meant to go out under latest. Just fixed it, and npm init astro should be working again

leonardopliski commented 3 years ago

Thanks!