clet icon indicating copy to clipboard operation
clet copied to clipboard

Fails in new node versions

Open YonatanKra opened this issue 3 years ago • 4 comments

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?

YonatanKra avatar Jul 06 '22 17:07 YonatanKra

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

atian25 avatar Jul 07 '22 01:07 atian25

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 avatar Jul 07 '22 05:07 YonatanKra

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

YonatanKra avatar Jul 07 '22 07:07 YonatanKra

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

beter to compile it to esm, not cjs

atian25 avatar Aug 30 '22 10:08 atian25