question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Getting "Multiple conflicting contents for sourcemap source" when trying to build app with rc.10

See original GitHub issue

Environment


  • Operating System: Darwin
  • Node Version: v14.19.3
  • Nuxt Version: 3.0.0-rc.10
  • Nitro Version: 0.5.3
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: alias, app, env, server, build, css, modules, ignore, publicRuntimeConfig, runtimeConfig, vite, storybook
  • Runtime Modules: @pinia/nuxt@0.4.2, @vueuse/nuxt@9.2.0, @nuxtjs/tailwindcss@5.3.3, ./modules/fonts/index.ts
  • Build Modules: -

Reproduction

I am unable to reproduce this, I only hope you might know how this sort of error can arrise. The error happens in multiple versions of node, i checked versions: 14, 16, 18

EDIT:

I can confirm the issue does not happen on rc.9.

Describe the bug

I have a project that works when using yarn dev, but when i try to build i get the following error: Multiple conflicting contents for sourcemap source /somepath/pages/vue-page.vue

I tried deleting the page and building but it just threw the same error for another page and so on for all pages.

The build was working when I was using rc.6 beforehand.

Additional context

No response

Logs

ERROR  Multiple conflicting contents for sourcemap source /path/pages/user/profile.vue                                                                                                                 16:06:31


 ERROR  Multiple conflicting contents for sourcemap source /path/pages/user/profile.vue                                                                                                                 16:06:31

  at error (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
  at Link.traceMappings (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:13934:32)
  at collapseSourcemaps (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:14027:63)
  at Chunk.render (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:14896:19)
  at processTicksAndRejections (internal/process/task_queues.js:95:5)
  at async node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:16006:40
  at async Promise.all (index 109)
  at async Bundle.addFinalizedChunksToBundle (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:16004:9)
  at async Bundle.generate (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:15984:13)
  at async node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:23754:27

Another Log

  at error (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:1858:30)
  at Link.traceMappings (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:13934:32)
  at collapseSourcemaps (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:14027:63)
  at Chunk.render (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:14896:19)
  at processTicksAndRejections (node:internal/process/task_queues:96:5)
  at async node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:16006:40
  at async Promise.all (index 116)
  at async Bundle.addFinalizedChunksToBundle (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:16004:9)
  at async Bundle.generate (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:15984:13)
  at async node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:23754:27
  at async catchUnfinishedHookActions (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:23088:20)
  at async doBuild (node_modules/vite/dist/node/chunks/dep-557f29e6.js:45822:20)
  at async Module.build (node_modules/vite/dist/node/chunks/dep-557f29e6.js:45653:16)
  at async buildServer (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.cbd4a916.mjs:589:5)
  at async bundle (node_modules/@nuxt/vite-builder/dist/shared/vite-builder.cbd4a916.mjs:825:3)
  at async build (node_modules/nuxt/dist/index.mjs:1992:5)
  at async Object.invoke (node_modules/nuxi/dist/chunks/build.mjs:46:5)
  at async _main (node_modules/nuxi/dist/cli.mjs:50:20)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:20 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
mehotkhancommented, Nov 24, 2022

Same issue on “nuxt”: “3.0.0”,

3reactions
ShaggyTechcommented, Sep 22, 2022

So I did some more debugging with the reproduction I shared. In my particular case there is only one component causing this issue - CardGroup.vue .

  1. If CardGroup component is not used then error goes away and build is successful, indicating this is the only component involved in the error.

  2. Removing the <script>...</script> from CardGroup.vue will make the error go away and build is successful. I’m only using it to name the component in this instance.

  3. Removing xl:(grid-cols-4 mt-20 px-8) windi class from CardGroup.vue#L7 makes the error go away and build is successful.

Doing either 2 or 3 independently will make the error go away.

To clarify the above:

  • <script> and no windi class = OK
  • windi class and no <script> = OK
  • <script> and windi class = ERROR

I put a breakpoint at Link.traceMappings (node_modules/vite/node_modules/rollup/dist/es/shared/rollup.js:13934:32) which is where the error is thrown.

class Link {
 ...
   traceMappings() {
    ...
 **   else if (content != null && sourcesContent[sourceIndex] !== content) {
        return error({
            message: `Multiple conflicting contents for sourcemap source ${filename}`
        });
    }
   ...
}

I noticed there is a difference in content and sourcesContent[sourceIndex] variables which triggers the error. I’m combining my classes via windicss such as xl:(mt-10 pt-10). Variable sourcesContent[sourceIndex] has them separated like xl:mt-10 xl:pt-10 (maybe a part of the windi build process?), but this does not match content which retains original string like xl:(mt-10 pt-10).

What doesn’t make sense is that I use these same windi class combinators in other components and they are fine. Also, why does removing the script and keeping the windi class build successfully?

This is about as far as I got and it’s a weird one, but hopefully this provides some help in resolving the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiple conflicting contents for sourcemap source error when ...
I used LazyClientOnly and there add a lazy import for the component like: Component2: () => import('./component-2') and works perfectly.
Read more >
JS, rollup.js: Application can't depend on a library if both ...
The workaround for now is to turn off sourcemaps in either the library or the application, but this isn't a great solution.
Read more >
how to fix err_http_response_code_failure - You.com | The AI ...
There are two ways you can fix this, either disable source maps in your browsers or generate source maps when your code compiles....
Read more >
GWT Release Notes
Add support to compile GWT itself in Java 9+. Improve compiled code size for applications that never use streams, by avoiding referencing streams...
Read more >
Kotlin Language Documentation 1.7.21
Adding Java source code to an existing Kotlin project ... If you have an existing Android application and want to make it cross-platform, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found