wallabyjs / quokka

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

Error: Your application tried to access graceful-fs #936

Closed MShuttle closed 4 months ago

MShuttle commented 4 months ago

Issue description or question

Is this issue related to Quokka not outputting the expected results of your code?: No

When attempting to start Quokka on any JavaScript file, Quokka does not start. The only information available is in the VSCode Quokka Extension Output panel. The total output is pasted below.

Completely removed Quokka, including all wallaby versions in the ~.vscode/extensions folder.

Reinstalling Quokka from did not resolve the issue.

Sample code

No Code

Quokka.js Console Output

// ​Quokka
/Users/admin/.pnp.cjs:12251 
    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/admin/.vscode/extensions/wallabyjs.quokka-vscode-1.0.627/dist/wallaby/ 
 
Require stack: 
- /Users/admin/.vscode/extensions/wallabyjs.quokka-vscode-1.0.627/dist/wallaby/server.js 
    at require$$0.Module._resolveFilename (/Users/admin/.pnp.cjs:12250:13) 
    at require$$0.Module._load (/Users/admin/.pnp.cjs:12100:42) 
    at Module.require (node:internal/modules/cjs/loader:1237:19) 
    at require (node:internal/modules/helpers:176:18) 
    at a (/Users/admin/.vscode/extensions/wallabyjs.quokka-vscode-1.0.627/dist/wallaby/server.js:14:114) 
    at /Users/admin/.vscode/extensions/wallabyjs.quokka-vscode-1.0.627/dist/wallaby/server.js:14:279 
    at 79../lib/app (/Users/admin/.vscode/extensions/wallabyjs.quokka-vscode-1.0.627/dist/wallaby/server.js:508:12837) 
    at a (/Users/admin/.vscode/extensions/wallabyjs.quokka-vscode-1.0.627/dist/wallaby/server.js:14:245) 
    at s (/Users/admin/.vscode/extensions/wallabyjs.quokka-vscode-1.0.627/dist/wallaby/server.js:14:403) 
    at Object.<anonymous> (/Users/admin/.vscode/extensions/wallabyjs.quokka-vscode-1.0.627/dist/wallaby/server.js:14:420) 
    at Module._compile (node:internal/modules/cjs/loader:1378:14) 
    at Module._extensions..js (node:internal/modules/cjs/loader:1437:10) 
    at Module.load (node:internal/modules/cjs/loader:1212:32) 
    at Module._load (node:internal/modules/cjs/loader:1028:12) 
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:142:12) 
    at node:internal/main/run_main_module:28:49 
 
Node.js v21.6.2 
 

Code editor version

Visual Studio Code Version: 1.86.2 (Universal) Commit: 903b1e9d8990623e3d7da1df3d33db3e42d80eda Date: 2024-02-13T19:42:13.651Z (1 wk ago) Electron: 27.2.3 ElectronBuildId: 26908389 Chromium: 118.0.5993.159 Node.js: 18.17.1 V8: 11.8.172.18-electron.0 OS: Darwin x64 22.6.0

OS name and version

OSX Ventura 13.6.4 Macbook Pro

smcenlly commented 4 months ago

We think that this issue is specific to your project / project dependencies.

Are you able to provide us with a sample repo that has the same problem? Alternatively, you may start by providing us with your package.json file. Based on the stack trace of the error, I assume you're using yarn@2+?

smcenlly commented 4 months ago

@MShuttle - bumping this issue as we haven't heard back.

MShuttle commented 4 months ago

@smcenlly —I'm sorry I didn't get back to you sooner. I am not using yarn at the moment, but I have used it in the past.

The problem is resolved. I did this, and I think it may be helpful to you going forward.

  1. Confirmed yarn is not present. // Not present
  2. Confirmed npm is not present // Not Present
  3. Removed and reinstalled pnpm using curl installation
  4. Deleted old Yarn artefacts
  5. Deleted the Yarn artefact file ~/.pnp.cjs
  6. Deleted ~/.yarn

Voila. A guess is that Quokka Init executed the artefacts even if the associated package manager was not used.

smcenlly commented 4 months ago

A guess is that Quokka Init executed the artefacts even if the associated package manager was not used.

Yes - if you had .pnp.cjs, Quokka would have used it for your project. It sounds like that caused the problem if you had it in your home directory.

Thanks for getting back to us :)