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

Production build crashes on Next v14.0.2. #477

Open
zirlman opened this issue Nov 18, 2023 · 5 comments
Open

Production build crashes on Next v14.0.2. #477

zirlman opened this issue Nov 18, 2023 · 5 comments

Comments

@zirlman
Copy link

zirlman commented Nov 18, 2023

I'm having issues with this library and Nextjs >= 14.0.2.

I've elaborated the issue on NextJS in detail
Issue: vercel/next.js#58623

TLDR; It looks like the module Math.sqrt is undefinedin your libary when ran on client-side

@eyyazubi
Copy link

im have the same error:

13-2f45628bbf53fb8d.js:5 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'sqrt')

function() {
function e(e) {
return (e - (0 | e)) * 4294967296 | 0
}
for (var t = 2, r = 0; r < 64; )
(function(e) {
for (var t = Math.sqrt(e), r = 2; r <= t; r++) <--- here
if (!(e % r))
return !1;
return !0
}
)(t) && (r < 8 && (c[r] = e(Math.pow(t, .5))),
l[r] = e(Math.pow(t, 1 / 3)),
r++),
t++
}(),

@dez1729
Copy link

dez1729 commented Nov 21, 2023

This also breaks pdfkit when trying to generate a pdf in build. Rolling nextjs back to 14.0.1 seem to fix the problem.

@ktpm489
Copy link

ktpm489 commented Dec 1, 2023

Use transpilePackages: [''crypto-js'] in next.config.js file. I build project success in product mode with next js 14.3 .

@ktpm489
Copy link

ktpm489 commented Dec 1, 2023

Screen Shot 2023-12-01 at 11 25 15 AM Sample

@JcobCN
Copy link

JcobCN commented Nov 19, 2024

Screen Shot 2023-12-01 at 11 25 15 AM Sample

it works.

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