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

npm run build failed + unused function is bundled to .next output folder #17208

Closed
oran1248 opened this issue Sep 18, 2020 · 5 comments
Closed
Labels
good first issue Easy to fix issues, good for newcomers

Comments

@oran1248
Copy link

oran1248 commented Sep 18, 2020

Bug report

Describe the bug

Build fails with non indicative error.
If I remove one of the packages jsonwebtoken or argon2, the build succeded.

I don't know why, but splitting the files - one file importing argon2 and one file importing jsonwebtoken solves the problem. Why?!

But together I get a weird build error...

To Reproduce

Expected behavior

Build succeeded.

Screenshots

image

System information

  • OS: Windows
  • Version of Next.js: 9.5.3
  • Version of Node.js: 12.16.3
@oran1248 oran1248 changed the title npm run build fails + unused function is bundled to .next output folder npm run build failed + unused function is bundled to .next output folder Sep 18, 2020
@timneutkens timneutkens added the good first issue Easy to fix issues, good for newcomers label Sep 21, 2020
@timneutkens
Copy link
Member

Feel free to investigate your issue and send a PR.

@oran1248
Copy link
Author

Feel free to investigate your issue and send a PR.

Solved it by seperating argon2 and jsonwebtoken (and of course the functions that used them) to two different files 🤹

@timneutkens
Copy link
Member

Interesting, not sure what happens there. Potentially it's just the dependency that you're using 🤔 Can this be closed then if it's resolved?

@oran1248
Copy link
Author

Yes you can close this issue as I solved it with a workaround.
But still this is very interesting case, I'm not sure if it's related to the dependencies or not.

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants