Open MarkiyanPyts opened 6 years ago
Attaching example project with an issue, issue.zip
I have also discovered that browserify can be a problem here as well, if it's removed from the pipeline it works.
Just wanted to add in my two cents. It seems this issue is related to babel-core merging source maps. If multiple files have been processed by babel-core, it will merge their source maps. This causes the file
attribute to be lost (instead, the sources
attribute is created, containing all relevant files that have been merged).
gulp-babel however, expects the file
attribute to still be there. It will pass res.map.file
into replaceExtension
, which will evaluate to null because the file
attribute was removed. replaceExtension
will in turn throw an error because it does not know how to handle file=null
.
By further digging it seems this issue may indeed also be related to browserify. The source maps all contain the file node_modules/browser-pack/_prelude.js
- which seems to be related to browserify. Removing browserify will fix the issue as the source map won't have to be merged for the extra browserify file.
Not sure yet on how to fix this (except for dropping browserify, if that's part of your options), but still wanted to put this up here in case others search for this issue.
After updating my node to "v8.11.1" and npm to "5.6.0" gulp build gets broken if used with "gulp-source-maps"
Here is my gulpfile:
js task fails with error "Path must be a string. Received undefined"
I traced the error to "node_modules/gulp-babel/index.js" line 39
where you gulp-babel has following code as this point:
Problem is that res.map.file here is undefined even though file.sourceMap and res.map has big JSON objects returned.
this breaks the build. Before update this setup was working properly.