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

Facing issue in importing nextjs #13

Closed
avneet2112 opened this issue Oct 8, 2021 · 5 comments
Closed

Facing issue in importing nextjs #13

avneet2112 opened this issue Oct 8, 2021 · 5 comments

Comments

@avneet2112
Copy link

avneet2112 commented Oct 8, 2021

When I try to use compress.js latest version i.e. 1.2.1 then it shows a build error that regenerator runtime cannot import from outside the module. Please look into it.

@maitrungduc1410
Copy link

same issue here. here's detail:

Module parse failed: 'import' and 'export' may appear only with 'sourceType: module' (2:0)
File was processed with these loaders:
 * ./node_modules/next-translate/lib/cjs/plugin/loader.js
You may need an additional loader to handle the result of these loaders.
| // Support regenerator-runtime globally.
> import "regenerator-runtime/runtime.js";
| 
| import Base64 from "./core/base64.js";

@nemanjam
Copy link

I get same build error in Next.js app.

@bruceharrison1984
Copy link

bruceharrison1984 commented Dec 27, 2021

I just got this as well in NextJS.

I ended up using https://www.npmjs.com/package/browser-image-compression instead. It's very similar to this, but it's already compiled in a compatible package type. It nearly a drop-in replacement.

@avneet2112
Copy link
Author

I also got a solution here.

You can restrict the compress.js to the last update where it has 0 dependencies.
inside your package.json
replace this
"compress.js": "^1.1.2",
with this
"compress.js": "1.1.2",

@alextanhongpin
Copy link
Owner

Should be fixed in 1.2.2

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

5 participants