wallabyjs / quokka

Repository for Quokka.js questions and issues
https://quokkajs.com
1.18k stars 31 forks source link

Quokka crash. Required package graceful-fs??? #901

Closed JoJe3003 closed 1 year ago

JoJe3003 commented 1 year ago

Issue description or question

Quokka woun't run and throws an error from a file called .pnp.cjs.

I have attempted to install graceful-fs globally, but that didn't help.

Quokka.js Console Output

​Quokka
/Users/name/.pnp.cjs:8711 
    throw firstError; 
    ^ 
 
Error: Your application tried to access graceful-fs, but it isn't declared in your dependencies; this makes the require call ambiguous and unsound. 
 
Required package: graceful-fs 
Required by: /Users/name/.vscode/extensions/wallabyjs.quokka-vscode-1.0.575/dist/wallaby/ 
 
Require stack: 
- /Users/name/.vscode/extensions/wallabyjs.quokka-vscode-1.0.575/dist/wallaby/server.js 
    at Function.require$$0.Module._resolveFilename (/Users/name/.pnp.cjs:8710:13) 
    at Function.require$$0.Module._load (/Users/name/.pnp.cjs:8564:42) 
    at Module.require (node:internal/modules/cjs/loader:1005:19) 
    at require (node:internal/modules/cjs/helpers:102:18) 
    at a (/Users/name/.vscode/extensions/wallabyjs.quokka-vscode-1.0.575/dist/wallaby/server.js:14:114) 
    at /Users/name/.vscode/extensions/wallabyjs.quokka-vscode-1.0.575/dist/wallaby/server.js:14:279 
    at Object.79../lib/app (/Users/name/.vscode/extensions/wallabyjs.quokka-vscode-1.0.575/dist/wallaby/server.js:496:11186) 
    at a (/Users/name/.vscode/extensions/wallabyjs.quokka-vscode-1.0.575/dist/wallaby/server.js:14:245) 
    at s (/Users/name/.vscode/extensions/wallabyjs.quokka-vscode-1.0.575/dist/wallaby/server.js:14:403) 
    at Object.<anonymous> (/Users/name/.vscode/extensions/wallabyjs.quokka-vscode-1.0.575/dist/wallaby/server.js:14:420) 
    at Module._compile (node:internal/modules/cjs/loader:1105:14) 
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10) 
    at Module.load (node:internal/modules/cjs/loader:981:32) 
    at Function.Module._load (node:internal/modules/cjs/loader:822:12) 
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12) 
    at node:internal/main/run_main_module:17:47 
 

Code editor version

Visual Studio Code 1.83.1

OS name and version

OSX Sonoma 14.0

smcenlly commented 1 year ago

It looks like you have accidentally run yarn in your /Users/name/ home directory, and it has created a .pnp.cjs file.

Quokka will try and to find and load your .pnp.cjs file for parent folders in order to support mono repos.

Is having yarn installed in your /Users/name/ directory intentional, we expect this may have happened by accident?

Because of node_module, yarn resolution, this is likely to cause problems for a number of JavaScript / TypeScript tools.

You should be able to remove this file (and associated node_modules) to fix the problem.

smcenlly commented 1 year ago

I'm going to close this issue as I think that will fix your problem. If you're still having issues, please reply and we'll re-open the issue.