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

Bug: SyntaxError: Cannot use import statement outside a module #797

Closed
humaidk2 opened this issue Oct 18, 2022 · 1 comment
Closed

Bug: SyntaxError: Cannot use import statement outside a module #797

humaidk2 opened this issue Oct 18, 2022 · 1 comment

Comments

@humaidk2
Copy link

Kept getting this when I was running tests using jest

SyntaxError: Cannot use import statement outside a module

After much investigation found out that supertest uses superagent on the latest version which is not recommended

superagent@8.0.2: Please use v8.0.0 until https://github.com/visionmedia/superagent/issues/1743 is resolved

Had to fix it by adding resolution to my package.json

"resolutions": {
        "superagent": "8.0.0"
    },

Hopefully, superagent@8.1.0 comes out this week and no one has the same issue

@humaidk2
Copy link
Author

Closed cause superagent:8.0.3 is out which fixes this

Similar to #798

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

1 participant