Skip to content
This repository has been archived by the owner on Jan 18, 2022. It is now read-only.

fix: Prevent conflicting filename for sourcemaps #375

Merged
merged 2 commits into from Oct 22, 2020
Merged

Conversation

pioug
Copy link
Contributor

@pioug pioug commented Jul 22, 2020

Fixes #238. Related to #215 and maybe #248.

Changes proposed in this pull request:

  • Rename file inside sourcemaps to avoid Rollup error

I think Rollup doesn't like that the Vue plugin outputs multiple sourcemaps with the same names because it triggers the following error when running rollup --watch:

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

https://github.com/rollup/rollup/blob/0ffbe94981a1201da851eb6001cce7bb5b8efb20/src/utils/collapseSourcemaps.ts#L79-L86

I have a dumb patch to propose, hoping to bring attention to the problem and get help to solve it properly. It's reproducing on v5 and also the new v6. I think since the sourcemaps have been introduced.

I ignore whether renaming the sourcemaps affects other parts of the build. So I choose to leave the sourcemaps for script untouched, while renaming the others (which are less critical, at least for my usage).

I read in one of the comments that it may be due to @vue/compiler-sfc... but I prefer to ask for help first before digging into that too 馃槄 I can write the tests once we are certain about the solution.

/ping @znck 馃檹

@danielvy
Copy link

I'm running into the same issue.

This makes the workflow pretty tedious as I need to enable/disable source maps every time or exit rollup's watch and rebuild the project.

Any idea if/when this is going to be fixed?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants