-
Notifications
You must be signed in to change notification settings - Fork 262
Description
Describe the bug
Running this repo results in an error from Stackblitz when booting up that does not occur locally running the exact same version of Node (v20.19.0)
ReferenceError: Cannot access 'generateCompilation' before initialization
at Module.get [as generateCompilation] (file:///home/projects/parignzygj.github/node_modules/@greenwood/cli/src/lifecycles/compile.js:7:55)
at run (file:///home/projects/parignzygj.github/node_modules/@greenwood/cli/src/index.js:69:52)
at eval (file:///home/projects/parignzygj.github/node_modules/@greenwood/cli/src/index.js:106:1)
at Generator.next (<anonymous>)
at _0x39070d (https://parignzygjgithub-0ce4.w-credentialless-staticblitz.com/blitz.fb22cd3d.js:31:831295)
at _0x138fc6.<computed>._0x46287a (https://parignzygjgithub-0ce4.w-credentialless-staticblitz.com/blitz.fb22cd3d.js:31:831837)
at async ModuleJob.run (https://parignzygjgithub-0ce4.w-credentialless-staticblitz.com/builtins.f5b24229.js:158:3353)
at async ModuleLoader.import (https://parignzygjgithub-0ce4.w-credentialless-staticblitz.com/builtins.f5b24229.js:157:5061)
at async asyncRunEntryPointWithESMLoader (https://parignzygjgithub-0ce4.w-credentialless-staticblitz.com/builtins.f5b24229.js:168:797)Link to the blitz that caused the error
https://stackblitz.com/github/projectevergreen/greenwood-getting-started
Steps to reproduce
- Go to the Stackblitz
- It should automatically run
npm run dev(or manually runnpm run devornpm run build)
Expected behavior
It should start the dev server and show a landing page (or successfully complete when running npm run build)

Parity with Local
- I have run the project in my local machine and I could not reproduce the issue.
Screenshots
Platform
- OS: macOS
- Browser: Chrome
- Version: 135
Additional context
I feel this is related to the recent bump in NodeJS version since I had tested this a few weeks ago prior to the bump when Web Containers was still on Node 18 and everything was working then.
In regards to the stack trace, this is the immediate line in Greenwood it is complaining about, but I don't see any reason why there would be a "before initialization" error?
https://github.com/ProjectEvergreen/greenwood/blob/v0.32.0/packages/cli/src/lifecycles/compile.js
(file:///home/projects/parignzygj.github/node_modules/@greenwood/cli/src/lifecycles/compile.js:7:55)For the rest of the stack trace
at run (file:///home/projects/parignzygj.github/node_modules/@greenwood/cli/src/index.js:69:52)
at eval (file:///home/projects/parignzygj.github/node_modules/@greenwood/cli/src/index.js:106:1)there must be some sort of Stackblitz secret sauce happening to this file since it is identifying a line (106) that doesn't exist in the source (source is less than 100 lines)
https://github.com/ProjectEvergreen/greenwood/blob/v0.32.0/packages/cli/src/index.js
Here is where generateCompilation is called from though, for reference
https://github.com/ProjectEvergreen/greenwood/blob/v0.32.0/packages/cli/src/index.js#L60
