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.

Remove inline sourcemap if largeFile is activated

See original GitHub issue

Using the following gulp pipeline, I’m facing the issue that the resulting bundle still contains the inline sourcemap, which was generated by rollupjs (more precise rollup-stream). At the same time the external sourcemap file is generated, written to directory and linked in the app.js-file correctly. If I deactivate the largeFile option, the result is the same, but the inline sourcemap becomes removed from my app.js-file, which is the behavour I would expect. Unfortunately, I cannot deactivate the largeFile option for my project, because the regex that is used by convert-source-map otherwise causes the build to crash due to a “Maximum call stack size exceeded” error.

My pipeline:

	return rollup({
		entry: paths.src.mainAotJsFile,
		sourceMap: true,
		context: 'window',
		treeshake: true,
		format: 'cjs',
		plugins: rollupPlugins
	})
		.pipe(source('app.js'))
		.pipe(buffer())
		.pipe(sourcemaps.init({largeFile: false, loadMaps: true}))
		.pipe(sourcemaps.write('.'))
		.pipe(gulp.dest(paths.dist.bundledDir));

I already had a short look into the code of gulp-sourcemaps and into the code of convert-source-map. Unfortunately, the seen behavior is a valid implementation, because the function that removes the inline sourcemap usually is based on the regex that tends to cause a “Maximum call stack size exceeded” error with large files 😕

I would be very happy, if we could find a smart solution for this problem 😃

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
phatedcommented, Mar 25, 2017

@nmccready it looks like someone “improved” the RegExp to be less greedy (my terminology might be incorrect here) so that it realizes it doesn’t match early and avoids blowing the stack but they removed the lastIndex stuff at the same time. Hopefully I hear back from them sooner than later.

0reactions
DSoko2commented, Mar 30, 2017

@phated I had a try with the current versions. Unfortunately, I’m facing the same results as described in my initial post…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remove file from gulp-sourcemaps - Stack Overflow
I am using gulp-sourcemaps to generate inline sourcemaps for my typescripts files, ... This more than doubles the size of the file.
Read more >
Changelog - Cypress Documentation
Whether enabled or disabled, this changes how Cypress cleans up the browser context before ... Cypress will include an inline source map in...
Read more >
4 Reasons Why Your Source Maps are Broken - Sentry Blog
It's possible to inline your entire original source code into the source map itself. Inside the source map, this is referred to as ......
Read more >
webpack/webpack - Gitter
I suspect the issue is in my tsconfig.json , because when I remove the query string ... I would "prefer" not to Manually...
Read more >
Document - 11.31 VRTS 5.0 MP1P1 VRTSvxfs Kernel Patch | HPE ...
This occurs when one of the clones of that file system is being removed. ... a large file (~>2GB) on a cluster mounted...
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