-
-
Notifications
You must be signed in to change notification settings - Fork 264
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
SyntaxError: Cannot use import statement outside a module #1907
Comments
quilljs is released as esm and with jest it could be a little bit hard to get things working. But you can try to use something like this in your jest.config
or you could create a default mock for quill module that is loaded in each test, or mock it manually by using PS: Same question at quilljs repo: slab/quill#4338 |
Hello there, I got the same issue and it does not seem to work even with Any idea why ? |
|
|
@luin not working on my side |
Then just mock the module ;-) or the whole quill-editor component
Am 30. Juli 2024 17:21:01 MESZ schrieb Alexandre Robin ***@***.***>:
…> `transformIgnorePatterns: ['node_modules/(?!quill)']` should do the trick. By default jest/babel-jest ignores files in node_module but we need to enable it for esm packages.
@luin not working on my side
--
Reply to this email directly or view it on GitHub:
#1907 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
The problem is actually in See slab/quill#4338 In particular, this workaround seemed to fix it for us. |
Hi there. Trying to use your module in my project (Angular 18, Nx, Jest etc), everything is working but I can't create unit tests because they fail everywhere I try to use my component that utilizes ngx-quill.
So, the problem is like this:
`
Test suite failed to run
`
Tried to dug the proposed links:
and googling the problem "SyntaxError: Cannot use import statement outside a module" - but without any success. What's wrong with my setup? Thanks.
The text was updated successfully, but these errors were encountered: