Do not inline sourcemaps in jake - source-map-support can't handle it #17732
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Internally,
source-map-support
(which we enable during tests/debugging for sourcemapped stack traces, and recently started inspecting during tests when we stopped using a noop logger for them) uses a regexp to find the source mapping url - except with inline sources and inline source maps, we have a 25MB file it operates over. With a backtracking regexp, this sometimes triggers this v8 behavior (if the heap is in heavy use - like when we're deep inside our test suite in a single process). This was causing tests to fail on our internal CI server. Best I can tell, this doesn't happen on travis because the memory pressure is different (specifically, travis is already on node8.3
, while both myself and the CI server (the only machines which repo'd this issue) were on node8.1.2
- best I can tell,8.1.3
apparently reduced the memory usage of the profiler API by instantiating fewer regexes in the node profiler polyfill).The fix is to just not use 15MB of inline sourcemaps. In the
Jakefile
, we were doing this to enable sourcemaps to work withruntests-browser
- but we've had this working for awhile without using inline sources in our implementation in theGulpfile
. So now theJakefile
no longer builds tests with inline sourcemaps and shells out togulp
to build tests for the browser.If you're using
jake
, you should not notice much of a difference in your workflow.