Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to concatenate file with multiple sourcemaps #181

Open
mattdsteele opened this issue Jul 28, 2017 · 3 comments
Open

Unable to concatenate file with multiple sourcemaps #181

mattdsteele opened this issue Jul 28, 2017 · 3 comments

Comments

@mattdsteele
Copy link

I've built a UMD bundle with Webpack 3.0.0, using devtool: '#source-map' as my source map generation option. It ends up producing a build with multiple //# sourceMappingUrl pragmas. For example:

/******/ ([
/* 0 */
/***/ (function(module, exports) {

module.exports = __WEBPACK_EXTERNAL_MODULE_0__;

/***/ }),
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
 /// code
};
//# sourceMappingURL=common.js.map

/***/ }),
/* 2 */
/***/ (function(module, exports, __webpack_require__) {

"use strict";
 /// code
};
//# sourceMappingURL=predicates.js.map

/// etc, to end of file:
//# sourceMappingURL=build.js.map

Only the final build.js.map exists on disk. But this code finds the first sourceMappingUrl and attempts to read it, which results in errors such as:

Warning: Unable to read "C:\code\node_modules\sample\common.js.map" file (Error code: ENOENT). Use --force to continue.

I'm not familiar enough with the source map spec to know how to resolve this, but other tools (gulp, Chrome) seem to read this file fine.

@skylarmb
Copy link

skylarmb commented Nov 28, 2017

EDIT: I was having this same issue, but I solved it.

Warning: Unable to read ".../assets/bower_components/es6-shim/es6-shim.map" file (Error code: ENOENT). Use --force to continue.

My issue was I was copying bower_components to my build directory but I was only copying *.js and not *.map as well, so the js files referenced source maps that did not exist in my build directory.

@AlmogCohen
Copy link

@skylarmb its a little late...but how did you manage to solve that? :) I believe I'm facing the same issue

@skylarmb
Copy link

@AlmogCohen My comment describes how i solved it. The sourcemaps were not being copied to the build directory. I believe (hard to remember) i solved this by just copying sourcemaps as well as .js files to the build directory during the build process.

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

No branches or pull requests

3 participants