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

Fails in new node versions #28

Open
YonatanKra opened this issue Jul 6, 2022 · 4 comments
Open

Fails in new node versions #28

YonatanKra opened this issue Jul 6, 2022 · 4 comments

Comments

@YonatanKra
Copy link

Running a simple test gives the error before the test runs:

Details:

    /node_modules/clet/lib/validator.js:80
    var _filename = (0, _dirnameFilenameEsm.filename)(import.meta);
                                                             ^^^^

    SyntaxError: Cannot use 'import.meta' outside a module

This happens after I've solved the rest of the ESM issues that are happening when running this with Jest.
Do you have some configuration in which this is working?

@atian25
Copy link
Member

atian25 commented Jul 7, 2022

it seems to be an ESM problem, could you provide a repository of reproducible code?

@YonatanKra
Copy link
Author

Hi,
Yea, it seems like it.
Here's the branch with clet:
https://github.com/YonatanKra/practica/tree/try-to-add-e2e
I've added a few babel and jest config's that were supposed to solve it - but no good.

@YonatanKra
Copy link
Author

When changing it to anything ESNext to ES2015 it gives:
image

@atian25
Copy link
Member

atian25 commented Aug 30, 2022

https://github.com/YonatanKra/practica/blob/try-to-add-e2e/tsconfig.json#L27

beter to compile it to esm, not cjs

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