[Help please] Cannot use import statement outside a module - Custom HTML transform #4216
Replies: 1 comment
-
for anyone facing this problem in the future,,
this was the fix, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there!
I'm wondering if anyone is able to help me, I'm having some problems with
jest
/ts-jest
when it comes to a custom transform, I am not using babel, I am running windows 11 x64, Node v18.18.0I keep getting this error from my html and hbs transform
this is my
jest.config.ts
fileand in my html transformer.. i have
Now my understanding is that
{ useESM: true }
should be telling ts-jest that this is a module and not a commonjs file, but it looks like its being completly ignored?I am using import's and exports all throughout my project, it builds fine using webpack and my tests also have imports in them - and they work, but some fail when the transformer is commented out (this is expected)
i dont really understand why everything else is working, but this transform isnt? (the hbs one isnt either, fails with the same error - but i imagine once i get one working i can get the other working)
the ts-jest.log file isnt giving me anything to go on either..
any help would be appreciated, and I do apologise for the text wall!
Beta Was this translation helpful? Give feedback.
All reactions