dlresende / extreme-carpaccio

Slicing and coding game
http://diegolemos.net/2016/01/07/extreme-carpaccio/
BSD 3-Clause "New" or "Revised" License
123 stars 116 forks source link

Chalk bump break imports #362

Closed tbellavia closed 6 months ago

tbellavia commented 6 months ago

Chalk bump break imports

Hello guys, I tried to run the server but got this error :

> extreme-carpaccio-server@1.0.0 start
> node bin/www

/private/tmp/extreme-carpaccio/server/javascripts/repositories.js:4
var chalk = require('chalk')
            ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /private/tmp/extreme-carpaccio/server/node_modules/chalk/source/index.js from /private/tmp/extreme-carpaccio/server/javascripts/repositories.js not supported.
Instead change the require of index.js in /private/tmp/extreme-carpaccio/server/javascripts/repositories.js to a dynamic import() which is available in all CommonJS modules.
    at Object.<anonymous> (/private/tmp/extreme-carpaccio/server/javascripts/repositories.js:4:13) {
  code: 'ERR_REQUIRE_ESM'
}

Node.js v21.7.1

I tried with the following conditions :

It seems that the culprit is the bump of Chalk 4.1.2 -> Chalk 5.3.0, when I checkout on commit 5859d8f80586cdde32f294e9cdf14ae9266a8470, it works.

Have a nice day. :)

dlresende commented 6 months ago

Thanks for raising an issue @Cardiox12

I created a PR with a temporary fix until we can deal with the chalk v4 > v5 migration.