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

[BUG] Fresh Install Blocker - Error: Cannot find package '@expo/spawn-async' when running pnpm dev #1005

Open
2 of 3 tasks
dougwithseismic opened this issue Jun 20, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@dougwithseismic
Copy link

dougwithseismic commented Jun 20, 2024

What happened?

Update: Seems to be an issue creating a new plasmo app inside a turbo repo. I've tried with pnpm and npm workspaces and all produce the same error on fresh installs.

Description:
I encountered an error when trying to run pnpm dev for a newly created Plasmo extension. The error indicates that the package @expo/spawn-async cannot be found. This issue seems to be related to the Plasmo dependencies.

Steps to Reproduce:

  1. Run pnpm create plasmo to create a new Plasmo extension project. (I've also tried pnpm dlx ...'
  2. Navigate to the project directory.
  3. Run pnpm dev.

Expected Behavior:
The development server should start without any errors.

Actual Behavior:
The following error is displayed:

Error: Cannot find package 'E:\Web Projects\_CLIENTS\WITHSEISMIC\living-in-prague\prague-living-turbo\node_modules\.pnpm\plasmo@0.88.0_@swc+core@1.5.29_@swc+helpers@0.5.5__@swc+helpers@0.5.5_ejs@3.1.10_lodash@4.17._kjttjxptm7iruwazjdsjwzhm6u\node_modules\@expo\spawn-async\package.json' imported from E:\Web Projects\_CLIENTS\WITHSEISMIC\living-in-prague\prague-living-turbo\node_modules\.pnpm\plasmo@0.88.0_@swc+core@1.5.29_@swc+helpers@0.5.5__@swc+helpers@0.5.5_ejs@3.1.10_lodash@4.17._kjttjxptm7iruwazjdsjwzhm6u\node_modules\plasmo\dist\index.js
Did you mean to import "@expo/spawn-async/build/spawnAsync.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:210:26)
    at packageResolve (node:internal/modules/esm/resolve:828:14)
    at moduleResolve (node:internal/modules/esm/resolve:914:18)
    at defaultResolve (node:internal/modules/esm/resolve:1119:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:511:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
  code: 'ERR_MODULE_NOT_FOUND'
}

Environment:

  • Plasmo version: 0.88.0
  • Node.js version: v22.2.0
  • npm version: 8.1.0
  • Operating System: Windows 10

Additional Information:
I have tried the following troubleshooting steps without success:

  1. Verified Node.js version compatibility (tried Node.js v18).
  2. Deleted node_modules and pnpm-lock.yaml, then reinstalled dependencies.
  3. Reinstalled Plasmo using pnpm add plasmo@0.88.0.

Please let me know if you need any additional information or if there are any other steps I can take to resolve this issue.

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 'E:\Web Projects\_CLIENTS\WITHSEISMIC\living-in-prague\prague-living-turbo\node_modules\.pnpm\plasmo@0.88.0_@swc+core@1.5.29_@swc+helpers@0.5.5__@swc+helpers@0.5.5_ejs@3.1.10_lodash@4.17._kjttjxptm7iruwazjdsjwzhm6u\node_modules\@expo\spawn-async\package.json' imported from E:\Web Projects\_CLIENTS\WITHSEISMIC\living-in-prague\prague-living-turbo\node_modules\.pnpm\plasmo@0.88.0_@swc+core@1.5.29_@swc+helpers@0.5.5__@swc+helpers@0.5.5_ejs@3.1.10_lodash@4.17._kjttjxptm7iruwazjdsjwzhm6u\node_modules\plasmo\dist\index.js
Did you mean to import "@expo/spawn-async/build/spawnAsync.js"?
    at legacyMainResolve (node:internal/modules/esm/resolve:210:26)
    at packageResolve (node:internal/modules/esm/resolve:828:14)
    at moduleResolve (node:internal/modules/esm/resolve:914:18)
    at defaultResolve (node:internal/modules/esm/resolve:1119:11)
    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
    at ModuleLoader.resolve (node:internal/modules/esm/loader:511:25)
    at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:38)
    at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
  code: 'ERR_MODULE_NOT_FOUND'
}

(OPTIONAL) Contribution

  • I would like to fix this BUG via a PR

Code of Conduct

  • I agree to follow this project's Code of Conduct
  • I checked the current issues for duplicate problems.
@dougwithseismic dougwithseismic added the bug Something isn't working label Jun 20, 2024
@dougwithseismic
Copy link
Author

Update: Seems to be an issue creating a new plasmo app inside a turbo repo. I've tried with pnpm and npm workspaces and all produce the same error on fresh installs.

@dougwithseismic
Copy link
Author

I think I managed to solve this by updating to the latest pnpm v9.4.0 and running pnpm create plasmo. If anyone else is stuck here, can you give it a go?

@reedjones
Copy link

I think I managed to solve this by updating to the latest pnpm v9.4.0 and running pnpm create plasmo. If anyone else is stuck here, can you give it a go?

for me what worked was solution here:
vercel/next.js#48593 (comment)

"pnpm": {
"overrides": {
"@swc/helpers@~0.4": "0.4.36"
}
}

@richardrigutins
Copy link

I've encountered the same error on Windows with pnpm v9.6.0 (plasmo v0.88.0).

What worked for me was creating the application in a folder with a shorter file path.
For instance, if I create the project inside C:\folderwithreallyreallyreallylongname\chrome-plasmo-extension-tests I get the error, while C:\folderwithlongname\chrome-plasmo-extension-tests works correctly.

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

3 participants