Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import problem with 7.1.1 #92

Closed
hstaudacher opened this issue Jan 19, 2024 · 1 comment
Closed

import problem with 7.1.1 #92

hstaudacher opened this issue Jan 19, 2024 · 1 comment

Comments

@hstaudacher
Copy link

After updating to boxen 7.1.1 we see the following error when executing our app.

/.../node_modules/ts-node/dist/index.js:851
            return old(m, filename);
                   ^
Error [ERR_REQUIRE_ESM]: require() of ES Module /.../node_modules/boxen/index.js from /.../app.ts not supported.
Instead change the require of index.js in /.../app.ts to a dynamic import() which is available in all CommonJS modules.

Our code imports boxen like this:

import boxen from 'boxen';

We use ts-node to run the app.

@sindresorhus
Copy link
Owner

This is a problem with ts-node, not this package. I recommend using tsx instead.

https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants