Next.js Discord

Discord Forum

Identifier 'n' has already been declared

Unanswered
Cão de Gado Transmontano posted this in #help-forum
Open in Discord
Cão de Gado TransmontanoOP
Hi there, I'm trying to debug an error I'm receiving after updating to Next JS 16. I did what the documentation suggested and switched to turbopack, and after adding a rule for SVGs, I was able to get everything working locally. I was psyched because the previous upgrade attempt, we were trying to keep webpack, but that kept introducing problems. I go to build and deploy my app, only to be met with what's in the thumbnail.

So far, I've tried downgrading from 16.1.1 to 16.1.0, I've tried adding the flag that produces production source maps to try and find the error, and I've tried scouring my code to see if I manually use 'n' anywhere in a big enough scope that would trip things up. Next JS 16 is the only package I've updated with this change, and everything is still working if I run it on Next JS 15.

My main question is: Can I un-minify the static chunks that this error is coming from? I want to see if it's a specific page that's causing the problem, like maybe a page is importing something twice on accident. If anyone else has seen this issue with Next JS 16 and has solved it, I would love to hear your perspective.

2 Replies

Cão de Gado TransmontanoOP
I tried out the bundle analyzer and this seems to be the problem chunk. Its location is the same place as the error and I don't see any other package that's part of this chunk but i'm going to keep looking. I updated this package to the latest version just in case but it hasn't worked yet and I'm still getting this error.
Cão de Gado TransmontanoOP
Bump