remix-run / blues-stack

The Remix Stack for deploying to Fly with PostgreSQL, authentication, testing, linting, formatting, etc.
https://remix.run/stacks
MIT License
943 stars 231 forks source link

Install an esm package dependency #231

Open github-mathieu-salles opened 7 months ago

github-mathieu-salles commented 7 months ago

Have you experienced this bug with the latest version of the template?

yes

Steps to Reproduce

Expected Behavior

Being able to use an esm package to my project

Actual Behavior

I'm getting this error

error /Users/.../node_modules/cypress: Command failed. Exit code: 1 Command: node index.js --exec install Arguments: Directory: /Users/.../node_modules/cypress Output: /Users/.../node_modules/cli-truncate/index.js:3 const stringWidth = require('string-width'); ^

Error [ERR_REQUIRE_ESM]: require() of ES Module /Users/.../node_modules/string-width/index.js from /Users/.../node_modules/cli-truncate/index.js not supported. Instead change the require of /Users/.../node_modules/string-width/index.js in /Users/.../node_modules/cli-truncate/index.js to a dynamic import() which is available in all CommonJS modules. at Object.<anonymous> (/Users/.../node_modules/cli-truncate/index.js:3:21) at Object.<anonymous> (/Users/.../node_modules/listr2/dist/renderer/default.renderer.js:4:21) { code: 'ERR_REQUIRE_ESM'

I tried to make the modification from this PR but without success. I might forget something 🤔 I can install these packages without problem to a project using remix without the template if it helps