You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On GitHub actions with Node.js 10, running : uvu packages "test.*\.js$" fails to run any tests and crashes with this stack trace:
ReferenceError: globalThis is not defined
at Object.exports.run (/home/runner/work/cssnano/cssnano/node_modules/.pnpm/[email protected]/node_modules/uvu/run/index.js:2:2)
at sade.version.option.option.option.option.option.action (/home/runner/work/cssnano/cssnano/node_modules/.pnpm/[email protected]/node_modules/uvu/bin.js:28:30)
The tests run as expected with uvu 0.5.5 on the same configuration.
Don't ask me why, but I was testing a package for Node.js v10 in 2023, and I stumbled upon this bug :D
The regression seems to come from the re-arrangement of the imports in uvu 0.5.6. Now, uvu/run imports uvu after a reference to globalThis, which is something that needs polyfilling. uvu itself, as well as esm (the package) actually take care of this, but running uvu -r esm will polyfill globalThis after it gets referenced.
Workaround: Run tests using node -r esm tests instead of uvu -r esm tests
To resolve this bug, one need to either: a) require esm before requiring uvu/run; or b) move the included globalThis polyfill all the way up to bin.js
On GitHub actions with Node.js 10, running :
uvu packages "test.*\.js$"
fails to run any tests and crashes with this stack trace:The tests run as expected with uvu 0.5.5 on the same configuration.
Link to CI failure: https://github.com/cssnano/cssnano/runs/7240283115?check_suite_focus=true
Node.js version: 10.24.1
OS: Ubuntu
The text was updated successfully, but these errors were encountered: