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

Display error for use in Next.js project #506

Open
sajjadramezani1373 opened this issue Nov 28, 2024 · 1 comment
Open

Display error for use in Next.js project #506

sajjadramezani1373 opened this issue Nov 28, 2024 · 1 comment
Labels
question Further information is requested

Comments

@sajjadramezani1373
Copy link

Hello. I added this package to my Next.js 13.4.2 project.
When running the project, the following error appears:

Error: Failed to load external module react-filerobot-image-editor: SyntaxError: Cannot use import statement outside a module

How can this issue be resolved, and is it possible to use this package with a Next.js project?

@AhmeeedMostafa
Copy link
Collaborator

AhmeeedMostafa commented Dec 30, 2024

@sajjadramezani1373 try to add the following in your next.config.js file

module.exports = {
   ...,
   transpilePackages: ['react-filerobot-image-editor'],
   ...
}

Hope that helps, and please bare in mind the package is for FE usage only, so u will need to avoid its rendering on BE side.

@AhmeeedMostafa AhmeeedMostafa added question Further information is requested and removed unseen labels Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants