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
Build creating multiple classes with the same name #65670
Comments
Hi, Could you try this out? module.exports = {
experimental: {
serverMinification: false,
....
},
....
} And see if that helps out? Also, you have two next.config files, you probably want to drop one of them. |
I removed the
It's still minifying from the looks of it as it's still changing the class names to Additional note: I tried the same thing but with using |
Turn off swcMinify too, that one is at the root of the config, not experimental |
Here's the updated config:
Unfortunately still getting the same error =/ Again tried on a couple browsers and ran build twice just in case. Just in case it is a cache thing: Do I need to delete old builds or by running |
I don't know what you mean by default/name exports. You mean in the config file? |
I wonder if you could try to set up a reproduction repository? like try to remove as much as possible from the business logic, and just keep the code that breaks |
I tried to remove as much as I could. I'm still getting an error that more than 1 item is being called the same thing. The good thing is that now there's a lot less collisions, but there's still collisions. To help separate things, I created a new branch: |
As an update. using the serverMinification and the swcMinify did nothing, but adding the following:
made it so minimization was no longer happening and everything is working again. I'm not sure if that means this is no longer a bug or not, but from the looks of other issues, this seems to creep up every so often, so not sure what the best fix is. |
Link to the code that reproduces this issue
https://github.com/thecaligarmo/ngu-idle-calculators
To Reproduce
I've linked my repository that's throwing the error, but not sure if it will show up properly. Basically what's happening, in my 'src/helpers/localStorage.ts' file, I'm importing a bunch of objects. When I do
npm run dev
everything works perfectly as each class has it's own name. When I build and then start the application (npm run build; npm run start
) I get a bunch of errors because a few of my classes are getting renamed to the same name.As an example, I added the following debugging code in the first
useEffect
(Line 26) functionI ended up getting the following (I've cut large chunks to make this easier to read)
You can see the first two (
AdvTraining
andAPItem
) both get mapped to the same object nameo
. This causes issues as my code no longer knows which object should be used and therefore everything breaks down.I'm newer to nextjs so I'm not sure if there's a way to disable this (force using object names instead of obfuscating them), but even with obfuscation, two different classes shouldn't have the same name.
Current vs. Expected behavior
When building, multiple classes are named the same name causing issues. When building each class should get a unique name.
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure, Runtime
Which stage(s) are affected? (Select all that apply)
next build (local), next start (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: