Skip to content
This repository was archived by the owner on Apr 28, 2025. It is now read-only.

Install an esm package dependency #231

@github-mathieu-salles

Description

@github-mathieu-salles

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

yes

Steps to Reproduce

  • Create a project using this template
  • Try to install an esm package (I used mine but also this one to be sure)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions