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

Quokka won't start - {"message":"[BABEL] [wallaby core]/runners/node/quokka@1.0.0/jsdomQuokkaPlugin.js: Unexpected token #807

Closed
ehahn9 opened this issue Aug 1, 2022 · 8 comments
Labels

Comments

@ehahn9
Copy link

ehahn9 commented Aug 1, 2022

Issue description or question

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

Sample code

Installed quokka extension, start vscode

Sample repository link

If the issue can not be reproduced just using the quokka file above
(for example because it requires/imports some files from your project),
please create a small repository where the issue can be reproduced.

Quokka.js Console Output

​​​​​Quokka PRO 'Untitled-3.ts' (node: v16.14.2, babel: v7.18.5, plugins: auto-detect:create-react-app, jsdom-quokka-plugin)​​​​
 
{"message":"[BABEL] [wallaby core]/runners/node/quokka@1.0.0/jsdomQuokkaPlugin.js: Unexpected token 'export'","stack":"./src/debug/index.ts:1\nexport * from './DebugPage';\n^^^^^^\n\nSyntaxError: Unexpected token 'export'\n    at Object.compileFunction (node:vm:352:18)\n    at wrapSafe (node:internal/modules/cjs/loader:1032:15)\n    at Module._compile (node:internal/modules/cjs/loader:1067:27)\n    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)\n    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)\n    at Object.newLoader [as .ts] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)\n    at Module.load (node:internal/modules/cjs/loader:981:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n    at Module.require (node:internal/modules/cjs/loader:1005:19)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at require (node:internal/modules/cjs/helpers:102:18)\n    at Object.<anonymous> (./node_modules/@babel/traverse/lib/path/index.js:10:14)\n    at Module._compile (node:internal/modules/cjs/loader:1103:14)\n    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)\n    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)\n    at Object.newLoader [as .js] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)\n    at Module.load (node:internal/modules/cjs/loader:981:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n    at Module.require (node:internal/modules/cjs/loader:1005:19)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at require (node:internal/modules/cjs/helpers:102:18)\n    at Object.<anonymous> (./node_modules/@babel/traverse/lib/context.js:8:13)\n    at Module._compile (node:internal/modules/cjs/loader:1103:14)\n    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)\n    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)\n    at Object.newLoader [as .js] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)\n    at Module.load (node:internal/modules/cjs/loader:981:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n    at Module.require (node:internal/modules/cjs/loader:1005:19)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at require (node:internal/modules/cjs/helpers:102:18)\n    at Object.<anonymous> (./node_modules/@babel/traverse/lib/traverse-node.js:8:16)\n    at Module._compile (node:internal/modules/cjs/loader:1103:14)\n    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)\n    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)\n    at Object.newLoader [as .js] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)\n    at Module.load (node:internal/modules/cjs/loader:981:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n    at Module.require (node:internal/modules/cjs/loader:1005:19)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at require (node:internal/modules/cjs/helpers:102:18)\n    at Object.<anonymous> (./node_modules/@babel/traverse/lib/index.js:34:21)\n    at Module._compile (node:internal/modules/cjs/loader:1103:14)\n    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)\n    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)\n    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)\n    at Object.newLoader [as .js] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)\n    at Module.load (node:internal/modules/cjs/loader:981:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:822:12)\n    at Module.require (node:internal/modules/cjs/loader:1005:19)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at Module.r.require ([wallaby core]/server.js:31:3401)\n    at require (node:internal/modules/cjs/helpers:102:18)\n    at _traverse (./node_modules/@babel/core/lib/index.js:221:16)\n    at Object.get [as traverse] (./node_modules/@babel/core/lib/index.js:180:12)\n    at Function.assign (<anonymous>)\n    at ./node_modules/@babel/core/lib/config/full.js:226:24\n    at Generator.next (<anonymous>)\n    at Function.<anonymous> (./node_modules/@babel/core/lib/ge 

Code editor version

Version: 1.69.2
Commit: 3b889b090b5ad5793f524b5d1d39fda662b96a2a
Date: 2022-07-18T16:32:39.000Z (1 wk ago)
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Darwin arm64 21.5.0

OS name and version

OSX 12.4

@smcenlly
Copy link
Member

smcenlly commented Aug 1, 2022

Could you please provide us with:

  1. The code that you were attempting to run with Quokka
  2. Your package.json file
  3. Your babel configuration for your project (if you have any)

@ehahn9
Copy link
Author

ehahn9 commented Aug 2, 2022 via email

@smcenlly
Copy link
Member

smcenlly commented Aug 2, 2022

We just tried to run Quokka in a newly created create-react-app and it's working for us with a vanilla install.

  1. package.json (attached)

Your package.json file didn't come through; I think you'll need to attach it manually in github.com vs. attaching via email.


Could you also confirm whether you have any .quokka configuration in your project OR a global ~/.quokka/config.json file and attach those?


The stack trace shows:

./src/debug/index.ts:1
export * from './DebugPage';
^^^^^^

SyntaxError: Unexpected token 'export'
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1032:15)
    at Module._compile (node:internal/modules/cjs/loader:1067:27)
    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)
    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Object.newLoader [as .ts] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (./node_modules/@babel/traverse/lib/path/index.js:10:14)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)
    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Object.newLoader [as .js] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (./node_modules/@babel/traverse/lib/context.js:8:13)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)
    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Object.newLoader [as .js] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (./node_modules/@babel/traverse/lib/traverse-node.js:8:16)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)
    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Object.newLoader [as .js] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (./node_modules/@babel/traverse/lib/index.js:34:21)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Module._0x292976.<computed> [as _compile] (eval at <anonymous> ([wallaby core]/node_modules/q/q.js:2075:6), <anonymous>:1:1118354)
    at Module._compile ([wallaby core]/node_modules/pirates/lib/index.js:99:24)
    at Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Object.newLoader [as .js] ([wallaby core]/node_modules/pirates/lib/index.js:104:7)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at Module.r.require ([wallaby core]/server.js:31:3401)
    at require (node:internal/modules/cjs/helpers:102:18)
    at _traverse (./node_modules/@babel/core/lib/index.js:221:16)
    at Object.get [as traverse] (./node_modules/@babel/core/lib/index.js:180:12)
    at Function.assign (<anonymous>)
    at ./node_modules/@babel/core/lib/config/full.js:226:24
    at Generator.next (<anonymous>)
    at Function.<anonymous> (./node_modules/@babel/core/lib/ge 

I'm trying to understand where export * from './DebugPage'; comes from. It appears to somehow get called from Quokka's JSDOM plugin at start up.

@ehahn9
Copy link
Author

ehahn9 commented Aug 3, 2022

Here's the uploaded package.json (had to add .txt for github uploader)

package.json.txt

There is an empty ({}) in ~/.quokka/package.json but nothing in the project directory.

Thanks for your help! I'd really like to be able to use the $99 renewal I just did 😉

@smcenlly
Copy link
Member

smcenlly commented Aug 3, 2022

Thanks for sending through your package.json. We set up a sample repo and can't replicate your error.

Could you please provide:

  1. As mentioned above, ~/.quokka/config.json
  2. Your TypeScript configuration (should be tsconfig.json in your project root)

Also, do you have a node_modules directory in your ~/.quokka directory? If so, please also try deleting that.

If it's easier for you to work through your problem in real-time, we also have a discord server: http://wallabyjs.com/chat. Someone from our team is normally online from around 7am +10 GMT until 7pm +10 GMT.

@smcenlly
Copy link
Member

smcenlly commented Aug 4, 2022

We've managed to reproduce your issue. Will let you know when we have an update.

@ehahn9
Copy link
Author

ehahn9 commented Aug 4, 2022 via email

@smcenlly
Copy link
Member

smcenlly commented Aug 4, 2022

Please update to the latest version of Quokka for VS Code (v1.0.496), it will fix your problem.

The reason you're not experiencing on a different computer will be because of a different project configuration.

The problem was actually in one of Quokka's dependencies, tsconfig-paths. Quokka uses this package to resolve your tsconfig.json compilerOptions.paths at runtime. What was happening was that it was resolving paths both within your project and in non-project files while it should only attempt to resolve paths for files that are part of your project.

It doesn't appear that this causes people problems outside of a Quokka context so we have updated Quokka to patch tsconfig-paths at runtime to fix your issue.

@smcenlly smcenlly closed this as completed Aug 4, 2022
@smcenlly smcenlly added the bug label Aug 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants