-
Notifications
You must be signed in to change notification settings - Fork 98
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 #191
Comments
What module version are you using v3 or v4 ? Usually this error is linked to the fact you are trying to import an ES module into a CommonJS module. You might have to set the |
I'll publish a commonJS version of the package 👍 |
As far as I can see @fratzinger I have feathers-authentication-management v4 installed in my project and in the dist folder it seems js files are correctly transpiled, no import but require instead. |
I ran into the same error today using ts-jest:
But I'm really not sure why I'm having this issue as other feathers packages writtenin TS import just fine. |
@sedouard What is strange is that your error is referencing the |
Oh sorry! I did forget I messed with the feathers-authentication-management
|
I think it is because my tsconfig is expecting commonjs modules?:
So I think when @fratzinger publishes a commonjs module version it should just work 🤞 |
I confirmed when I make the change in this project's
Then I can successfully import this module into my project. Not sure what effects adding the |
I confirm that this is a problem and it's my fault. I messed up in a commit for version 4.0.1: f7e6ec3#diff-b55cdbef4907b7045f32cc5360d48d262cca5f94062e353089f189f4460039e0L7 |
Released as version |
Steps to reproduce
Install into feathers v4 app using js.
feathers-gen-specs.json
file from your app.src/services/[serviceName]/[serviceName].schema.?s
files if the issue involves the fields in one or more services.These last 2 items usually allow us to regen enough of your app to recreate the issue.
We may otherwise ask you to provide a minimal GitHub repo or gist isolating the issue.
Expected behavior
Tell us what should happen
Actual behavior
Tell us what happens instead
System configuration
Tell us about the applicable parts of your setup.
Module versions (especially the part that's not working):
NodeJS version:
Operating System:
Browser Version:
React Native Version:
Module Loader:
The text was updated successfully, but these errors were encountered: