Closed kevinramharak closed 9 months ago
@kevinramharak Thank you! I haven't been able to confirm the details yet, but it seems that the following error occurs when I run yarn run test.
$ yarn run test
yarn run v1.22.10
$ vitest
DEV v1.3.1 /home/laineus/works/phavuer-kevin
Browser runner started at http://localhost:5173/
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Error: require() of ES Module /home/laineus/works/phavuer-kevin/node_modules/wrap-ansi/index.js from /home/laineus/works/phavuer-kevin/node_modules/cliui/build/index.cjs not supported.
Instead change the require of index.js in /home/laineus/works/phavuer-kevin/node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules.
❯ Object.<anonymous> node_modules/cliui/build/index.cjs:293:14
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
Serialized Error: { code: 'ERR_REQUIRE_ESM' }
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
@laineus I'll take another look, I noticed weird behaviour based on whether node_modules
was already present or not. There are 3 packages that have this ESM/CJS mess. I think all of them are a dependency of cliui
so maybe I can pin that to a working version.
@laineus This is caused by a resolution bug in yarn v1. The package jackspeak
updated cliui
to ^8.0.1
here which causes this mess, although its really a yarn v1 problem that is fixed in version 2.
I pinned jackspeak
to 2.1.1
as suggested here, that seems to work, you might have to remove node_modules
once because it seems yarn is stubborn on keeping the old broken packages even though the package.json and yarn.lock list different versions.
@kevinramharak It's working correctly now! Since there are no issues, I'll merge it.
Thank you for the great work!
Fixes #4
This PR implements:
vitest
as a test runner with its browser modeGameConfig.banner !== false
before logging the phavuer banner to the consoleGame
componentNotes: The addition of:
is needed because of https://github.com/isaacs/jackspeak/issues/5. Long story, but it comes down to require/esm being a huge mess when coupled with npm dependency hell.