-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Cannot read properties of undefined (reading 'sqrt') #415
Comments
@aliberkyurtoglu I was able to resolve this issue by disabling "swcMinify" in next.config and by adjusting "next-transpile-modules" to resolveSymlinks: false. Check each one separately, I'm still working out which was the exact cause. |
@kdy1 Same problem in version 1.3.96 |
@luckyyyyy 1.3.96? Can you provide a minimal reproduction, or file an issue on https://github.com/swc-project/swc ? |
@kdy1 Same error happening to production build, when upgrading from next@14.0.1 to next@14.0.2 |
@nassimbenkirane Can you provide a minimal reproduction? |
let me try |
Oh I didn't see that you were doing the same @luckyyyyy Step 2: click "Start Server 3000" under the + button |
Same issue with Next.js 14.0.2 |
I've started to get the same error after upgrading to next 14. |
Can you assign this to me? |
I've faced the same issue, swcMinify: false is not an option for me since it breaks the entire build on production. |
**Description:** Regarding vercel/next.js#55682, I made a mistake while investigating. I assumed it's `swcMinify`-only but it seems like `node-fetch` is fundamentally incompatible with our minification options. I thought `node-fetch` works with terser, but it did not, and it **should not**. But as I thought `terser` works, I assumed that `terser` has a hack for `AbortSignal`. And that's how I fixed `swcMinify: true`. The correct fix is `keep_classnames: true` but it will result in +~10% bundle size bloat. At first, I used the correct way (`keep_classnames: true`), but it resulted in the bundle size bloat, so I mimicked the hack of terser with vercel/next.js#57904. While working on other minification issues, I found that there's no such hack in `terser` and I need to remove the hack in the SWC minifier. The repro in vercel/next.js#55682 does not work with `swcMinify: false`, even with next@14. The problem of minifier and node-fetch was not exploited before `serverMinification: true`. **Related issue:** - brix/crypto-js#415
same issue that randomly appeared today for me on a yarn upgraded repo.
Changed my imports to this to decode some code in Next js and its now production building and rendering. I think something weird is happening with the globally scoped imports and Next JS bundling. latest v14. Strangely it was working with V14 and 4.1.1 version for a while but I did a global yarn install/refresh of state (using berry) and it then happened to start using the 4.2.0 release. I lost 4 hrs of my life debugging this and there is 0 errors on the Typescript side or local This will get it working until you guys figure out how to get your packaging compliant with the bundlers next js v14 are using. |
I made sure I cleaned the This is the joys of the transient dependencies and version problems you get in npm/yarn projects. Do you have multiple crypto js versions loaded through other libs or just 4.2.0? Sorry its not working for you, I had to comment everything out, add in bit by bit until it started to work again. |
I am following the steps below.
If I comment out the encrypted part, it works fine, so it seems that there is a problem with the encrypted part. |
Can you share a snippet of the code that your using inc the imports etc? Try and see what might be causing it to fail? |
encrypt
decrypt
|
it was working for decrypt for me, sorry I can't help more. I do some occassional encrypt and it worked here as well. its worth checking your node_modules and doing a Otherwise go back to v13 next. not a great solution but the only one to get you moving forward. |
@null-prophet |
To me that seems ok, you have only one version depedency on 4.2.0 and the types are fine. If it works in V13 next I would just revert, I have no idea why it worked for me and not you. Perhaps the dev team will have a solution soon. |
@null-prophet It works fine with Next.js v13. |
no problem, delete away. |
@null-prophet |
|
vercel/next.js#58517 will fix it. (Waiting for vercel/turborepo#6472 to get merged first) |
Also have the same error. Tried to downgrade to next 13 to get back a stable build and now I am exceeding the maximum call stack size |
i'm using next js 14.0.3 and crypto-js 4.2.0, i used this configuration, and solved my problem
https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages |
Is this still an issue with the next canary? ( |
Hey @kdy1, Just tested it right now. |
this worked for me thanks |
|
This solved my issue I was using pdfMake and this made it work again. THANK YOU! |
We have been using it in our project for 3-4 months. But for the last 2 days, we have been experiencing problems in our application due to this error. What could be the problem? If anyone has encountered this problem before, please help. @evanvosberg
Error
hashHelper.ts
The text was updated successfully, but these errors were encountered: