Multiple assets emit different content to the same filename ../main.js.nft.json
See original GitHub issueWe are trying to migrate from a CRA-based React app to NextJS by importing the root component directly in the Next build. Our plan is to get Next building our bundles, and then we can migrate the pages out one by one without having to do everything at once.
The project uses npm workspaces.
// new-app/pages/index.tsx
import RootComponent from '@watershed/app/src/admin/AdminRoot';
function HomePage() {
return <RootComponent />;
}
export default HomePage;
When we run next build
we get an unexpected error without enough context to resolve:
> @watershed/app-admin@0.1.0 build
> next build
info - Checking validity of types
info - Creating an optimized production build
Failed to compile.
Conflict: Multiple assets emit different content to the same filename ../main.js.nft.json
> Build failed because of webpack errors
npm ERR! Lifecycle script `build` failed with error:
npm ERR! Error: command failed
npm ERR! in workspace: @watershed/app-admin@0.1.0
npm ERR! at location: /Users/adamrneary/github/ghg/client/workspaces/app-admin
What would be the best way to diagnose this? Is this something folks have seen before? Happy to collaborate on a fix, but I am not sure where to start. Thanks in advance for your time!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Conflict: Multiple assets emit to the same filename
what I want to know is what tool writes an error like "Conflict: Multiple assets emit to the same filename slots.js". Why would...
Read more >JavaScript : Conflict: Multiple assets emit to the same filename
JavaScript : Conflict: Multiple assets emit to the same filename [ Gift : Animated Search Engine : https://bit.ly/AnimSearch ] JavaScript ...
Read more >Multiple assets emit different content to the same filename ...
js in src\assets\metronic\vendors\global,@fortawesome so that the app will reference the files in \node_modules@fortawesome?
Read more >Multiple assets emit to the same filename bundle.js - Laracasts
I can get the most basic tests running with just a webpack config file to use vue-loader on .vue files, but as soon...
Read more >Advanced Features: Output File Tracing - Next.js
json files emitted to the .next output directory, you can read the list of files in each trace that are relative to the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ivantm I appreciate that (in earnest), but we’re trying to get this working with Next 12.
@shifengdiy I have it working with an up-to-date NextJS 12. Below is the relevant code. It uses some custom language service, but it’ll hopefully give you the idea…
Hope this helps.