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

Support ES modules #98

Open
tensor5 opened this issue Nov 29, 2021 · 2 comments
Open

Support ES modules #98

tensor5 opened this issue Nov 29, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@tensor5
Copy link

tensor5 commented Nov 29, 2021

I structured my TypeScript NodeJS app as ES modules ("type": "module" in package.json). This is the output of testyts:

An error occured while executing the following command: /usr/bin/node <REDACTED>/node_modules/.bin/testyts. Error: "Must use import to load ES Module: <REDACTED>/src/app.spec.ts
require() of ES modules is not supported.
require() of <REDACTED>/src/app.spec.ts from <REDACTED>/node_modules/testyts/build/lib/utils/testsLoader.js is an ES module file as it is a .ts file whose nearest parent package.json contains "type": "module" which defines all .ts files in that package scope as ES modules.
Instead change the requiring code to use import(), or remove "type": "module" from <REDACTED>/package.json.
"
@Aboisier
Copy link
Collaborator

Aboisier commented Dec 4, 2021

Hi!

Thanks for reporting this, I'll take a look at your issue next week! :)

@Aboisier Aboisier added the bug Something isn't working label Dec 11, 2021
@Aboisier
Copy link
Collaborator

Aboisier commented Dec 11, 2021

I managed to reproduce your issue with an end to end test. I'm not sure how to fix this yet, but I'm currently exploring different solutions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants