hayes0724 / shopify-packer

Modern development tool for Shopify using Webpack 5. Easy to extend and customize, zero build config, compatible with Slate and existing websites.
https://hayes0724.github.io/shopify-packer/
MIT License
181 stars 37 forks source link

[BUG] Chalk v5 does not allow 'require' breaking new installations #147

Closed henrybarn closed 2 years ago

henrybarn commented 2 years ago

Describe the bug I just setup packer for the first time and could not run any commands due to chalk being imported with require since it is now an ESM. Chalk is pinned at latest in the package.json. Changing this to ^4 fixed the issue for me.

To Reproduce Steps to reproduce the behavior:

  1. npm install on a clean environment.
  2. Run packer init

System (please complete the following information):

Packer (please complete the following information):

Theme (please complete the following information):

quentin-f451 commented 2 years ago

Same problem here, maybe Chalk would need to be set to v4 for the moment?

Eben-Hafkamp commented 2 years ago

All modules in package.json that reference the "latest" version need to reference a version of themselves that support commonjs requires() instead. Unless using the latest version of this library which was migrated to webpack5 and resolved the package version numbers

marioloncarek commented 2 years ago

we fixed the problem by manually setting chalk to 4.1.2 and running npm install in packers global installation folder

Kadreev commented 2 years ago

I can confirm by setting chalk to 4.1.2 and reinstalled the module, the issue is resolved.

Some more details for newbies: in the global installation folder ...\node_modules\@hayes0724\shopify-packer\ file package.json "chalk": "latest" >>>> "chalk": "^4.1.2" then just run from the same dir npm uninstall chalk npm install chalk@4.1.2 --save

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 2.3.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: