PlasmoHQ / plasmo

🧩 The Browser Extension Framework
https://www.plasmo.com
MIT License
10.31k stars 358 forks source link

New project from `with-nextjs` template build fails with `@expo+spawn-async` module not found [BUG] #1006

Open reedjones opened 3 months ago

reedjones commented 3 months ago

What happened?

A bug happened! similar to https://github.com/PlasmoHQ/plasmo/issues/1005

Creating new project from the with-nextjs template, running pnpm dev and/or build fails with error @expo+spawn-async module not found

Version

Latest

What OS are you seeing the problem on?

Windows

What browsers are you seeing the problem on?

No response

Relevant log output

Error: Cannot find package 'C:\Users\reedjones\projects\aproject\node_modules\.pnpm\plasmo@0.88.0_@swc+core@1.6.3_@swc+helpers@0.5.11__@swc+helpers@0.5.11_lodash@4.17.21_postcss_ixtk6kqqre7ufn5wc7sfmsvufe\node_modules\@expo\spawn-async\package.json' imported from C:\Users\reedjones\projects\aproject\node_modules\.pnpm\plasmo@0.88.0_@swc+core@1.6.3_@swc+helpers@0.5.11__@swc+helpers@0.5.11_lodash@4.17.21_postcss_ixtk6kqqre7ufn5wc7sfmsvufe\node_modules\plasmo\dist\index.js
Did you mean to import @expo+spawn-async@1.7.2/node_modules/@expo/spawn-async/build/spawnAsync.js?
    at legacyMainResolve (node:internal/modules/esm/resolve:213:26)     
    at packageResolve (node:internal/modules/esm/resolve:831:14)        
    at moduleResolve (node:internal/modules/esm/resolve:901:20)
    at defaultResolve (node:internal/modules/esm/resolve:1121:11)       
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)   
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
    at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:85:39)
    at link (node:internal/modules/esm/module_job:84:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v21.5.0
 ELIFECYCLE  Command failed with exit code 1.
   ▲ Next.js 14.1.0


### (OPTIONAL) Contribution

- [ ] I would like to fix this BUG via a PR

### Code of Conduct

- [X] I agree to follow this project's Code of Conduct
- [X] I checked the [current issues](https://github.com/PlasmoHQ/plasmo/issues?q=is%3Aopen+is%3Aissue+label%3Abug) for duplicate problems.
reedjones commented 3 months ago

I was able to solve using solution here: https://github.com/vercel/next.js/issues/48593#issuecomment-1681930868

"pnpm": {
  "overrides": {
    "@swc/helpers@~0.4": "0.4.36"
  }
}
dougwithseismic commented 3 months ago

Potentially fixed by moving to pnpm 9.4.0 (released a few days ago). No guarantee though, I tried a load today! https://github.com/PlasmoHQ/plasmo/issues/1005#issuecomment-2181581162