-
Notifications
You must be signed in to change notification settings - Fork 15
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
error on import #5
Comments
What environment are you using it in? |
yarn package manager next.js with the following packages
|
@benmneb any ideas? |
Not sure. I think I've only seen this error with back-end stuff. I just Can you reproduce the error in a codesandbox? I assume you looked at these questions? |
Getting the same error. Also running Nextjs, which I guess is a mix of backend and frontend. Reproduced the error in a minimal The question you linked refers to
|
the same thing happens to me, it has to do with next js and ssr |
` SyntaxError: Cannot use import statement outside a module
I am facing similar error with react. The import happens easily but during tests it gives this. |
I also get this error when using import in a remix-js project.
|
Issue still persisting |
I got the same error when building.
From error message, I think ways to import in Then, I could build my React application with mui-image built with above code. I haven't understood exactly why it works with this change, so there may be better way. |
Any update on this @benmneb? |
You're absolutely right about the imports. From the MUI docs:
|
Ahh, I also couldn't found this... I'm so glad to help you! ;) |
The problem with this is a ~4x increase in bundle size, due to the import coming from So use |
Thank you @benmneb ! I also confirmed that it works on my project with |
I have tried importing this as both
import { Image } from "mui-image";
and
import Image from "mui-image";
in both instances I get the following error
error - SyntaxError: Cannot use import statement outside a module
It is simply in a list of other imports and if I remove it all is fine.
The text was updated successfully, but these errors were encountered: