Comments (8)
Can you please post your directory structure and the way you are requiring bootstrap-webpack.
Also use webpack -c --display-error-details
. This will provide a verbose error description.
from bootstrap-webpack.
I have same issue...
/srv/template webpack -c --display-error-details
Hash: 9d260b4b83a9893fd081
Version: webpack 1.7.2
ERROR in (undefined) ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/source-map-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./bootstrap.config.js 2:0-248
Child
Hash: 9d260b4b83a9893fd081
Version: webpack 1.7.2
Time: 958ms
[0] multi main 52 {0} [built]
+ 44 hidden modules
ERROR in ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/source-map-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./bootstrap.config.js 2:0-248
Paying attention on this line:
'/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
Then ... removed source-map-loader for bootstrap config files like that (loader config):
{test: /\.js$/, exclude: /(node_modules)|(bootstrap.config)/, loader: "source-map"}
BTW I have no clue why it helped ...
I should notice that babel-loader also breaks build:
/srv/template webpack -c --display-error-details
Hash: 8f6333fd17046d642014
Version: webpack 1.7.2
ERROR in (undefined) ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/babel-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/babel-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./bootstrap.config.js 2:0-243
Child
Hash: 8f6333fd17046d642014
Version: webpack 1.7.2
Time: 970ms
[0] multi main 52 {0} [built]
+ 44 hidden modules
ERROR in ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/babel-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/babel-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./bootstrap.config.js 2:0-243
If I exclude babel-loader for bootstrap.config, it builds...
from bootstrap-webpack.
'/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
It appears to be that the same loader is mentioned twice.
Please try these three options to analyse or pinpoint the cause.
js
require('bootstrap-webpack!relative_path_to_bootstrap.config.js');
require('bootstrap-webpack!source-map-loader!relative_path_to_bootstrap.config.js');
Let us know the result.
from bootstrap-webpack.
require('bootstrap-webpack!relative_path_to_bootstrap.config.js');
:
user@c9ebdee9bdb6:/srv/template$ webpack
Hash: 5b85d768c400e7f98032
Version: webpack 1.7.2
ERROR in (undefined) ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/babel-loader!./~/source-map-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/babel-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./bootstrap.config.js 2:0-222
Child
Hash: 5b85d768c400e7f98032
Version: webpack 1.7.2
Time: 3110ms
[0] multi main 40 {0} [built]
+ 90 hidden modules
ERROR in ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/babel-loader!./~/source-map-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/babel-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./bootstrap.config.js 2:0-222
Child extract-text-webpack-plugin:
+ 7 hidden modules
Child extract-text-webpack-plugin:
+ 74 hidden modules
require('source-map-loader!relative_path_to_bootstrap.config.js');
: http://pastebin.com/0DU6JPja
require('bootstrap-webpack!source-map-loader!relative_path_to_bootstrap.config.js');
:
user@c9ebdee9bdb6:/srv/template$ webpack
Hash: e00101b8213dffc11301
Version: webpack 1.7.2
ERROR in (undefined) ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/source-map-loader!./~/babel-loader!./~/source-map-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/babel-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./~/source-map-loader!./bootstrap.config.js 2:0-276
Child
Hash: e00101b8213dffc11301
Version: webpack 1.7.2
Time: 3101ms
[0] multi main 40 {0} [built]
+ 90 hidden modules
ERROR in ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/source-map-loader!./~/babel-loader!./~/source-map-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/babel-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./~/source-map-loader!./bootstrap.config.js 2:0-276
Child extract-text-webpack-plugin:
+ 7 hidden modules
Child extract-text-webpack-plugin:
+ 74 hidden modules
Also, with other loaders removed:
require('bootstrap-webpack!../bootstrap.config.js');
:
user@c9ebdee9bdb6:/srv/template$ webpack
Hash: df6e9cc941cd9da02224
Version: webpack 1.7.2
Child
Hash: df6e9cc941cd9da02224
Version: webpack 1.7.2
Time: 3789ms
Asset Size Chunks Chunk Names
f4769f9bdb7466be65088239c12046d1.eot 20127 [emitted]
448c34a56d699c29117adc64c43affeb.woff2 18028 [emitted]
fa2772327f55d8198301fdb8bcfc8158.woff 23424 [emitted]
e18bbf611f2a2e43afc071aa2f4e1512.ttf 45404 [emitted]
89889688147bd7575d6327160d64e760.svg 108738 [emitted]
main.js 357469 0 [emitted] main
main.css 165129 0 [emitted] main
main.js.map 433449 0 [emitted] main
main.css.map 85 0 [emitted] main
[0] multi main 40 {0} [built]
+ 104 hidden modules
Child extract-text-webpack-plugin:
+ 7 hidden modules
Child extract-text-webpack-plugin:
+ 74 hidden modules
require('source-map-loader!relative_path_to_bootstrap.config.js');
: http://pastebin.com/72XWuKzR
require('bootstrap-webpack!source-map-loader!relative_path_to_bootstrap.config.js');
:
user@c9ebdee9bdb6:/srv/template$ webpack
Hash: a35ec6fcc70ee9618f28
Version: webpack 1.7.2
ERROR in (undefined) ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/source-map-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./~/source-map-loader!./bootstrap.config.js 2:0-173
Child
Hash: a35ec6fcc70ee9618f28
Version: webpack 1.7.2
Time: 3053ms
[0] multi main 40 {0} [built]
+ 90 hidden modules
ERROR in ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/source-map-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/source-map-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./~/source-map-loader!./bootstrap.config.js 2:0-173
Child extract-text-webpack-plugin:
+ 7 hidden modules
Child extract-text-webpack-plugin:
+ 74 hidden modules
Also, with babel-loader turned on:
user@c9ebdee9bdb6:/srv/template$ webpack
Hash: 76945b48f10eaf3c8d2b
Version: webpack 1.7.2
ERROR in (undefined) ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/babel-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/babel-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./bootstrap.config.js 2:0-168
Child
Hash: 76945b48f10eaf3c8d2b
Version: webpack 1.7.2
Time: 3219ms
[0] multi main 40 {0} [built]
+ 90 hidden modules
ERROR in ./~/bootstrap-webpack/bootstrap-scripts.loader.js!./~/babel-loader!./bootstrap.config.js
Module build failed: Error: Cannot find module '/srv/template/node_modules/babel-loader/index.js!/srv/template/bootstrap.config.js'
at Function.Module._resolveFilename (module.js:320:15)
at Function.Module._load (module.js:262:25)
at Module.require (module.js:349:17)
at require (module.js:368:17)
at Object.module.exports.pitch (/srv/template/node_modules/bootstrap-webpack/bootstrap-scripts.loader.js:20:16)
@ ./~/bootstrap-webpack/index.loader.js!./bootstrap.config.js 2:0-168
Child extract-text-webpack-plugin:
+ 7 hidden modules
Child extract-text-webpack-plugin:
+ 74 hidden modules
Quite interesting, isn't it?
from bootstrap-webpack.
source-map-loader --> extracts inlined source map and offers it to webpack.
babel loader --> Turn ES6 code into vanilla ES5 with no runtime required using babel.
But, bootstrap javascript code is written ES5 without inline source maps. Also, the config file used is understood only by bootstrap-webpack loader and not others. I'm not sure why are you(@ColCh) using other loaders to load bootstrap js files.
@deanshub, Any updates ?
from bootstrap-webpack.
@gowravshekar that loader list appends automatically because they are "global" ... It's needed to add bootstrap.config to every loader exclude option
from bootstrap-webpack.
@ColCh, Yes using global settings(*.js) to apply loaders will affect bootstrap-webpack.
To overcome this, you can use the below options(1/2/combinations)
- Use
exclude
option of the module.loaders section of the config. - Adjust the regex in
test
option of the module loaders to prevent matching all the js files to which the loaders are applied.
To give an example, use *.config.js
for all your config files and and use the regex /^((?!\.config\.).)*\.js$/
to prevent parsing of config files in the global test settings.
The provided regex doesn't match any files of the pattern *.config.js but matches rest of *.js.
See the explanation of different module options under module.loaders
http://webpack.github.io/docs/configuration.html
from bootstrap-webpack.
May be add that to README ? Looks not so obvious
from bootstrap-webpack.
Related Issues (20)
- support latest 3.x HOT 4
- I recomed integrating with and syncing bs version to: https://github.com/valor-software/ng2-bootstrap HOT 1
- cannot resolve path (or pattern) './src/**/*.spec.js'
- Unmet dependencies .. HOT 3
- Import order not allowing overrides HOT 2
- extract-text-webpack-plugin loader usage without plugin error HOT 1
- Use resolve loader
- Give example for using it in a global namespace HOT 1
- bootstrap.config.js doesn't work (in my config) HOT 3
- Cannot find module 'style!css!less!./bootstrap-styles!./bootstrap.config.js' HOT 9
- Can I move bootstrap to a "dll" bundle with bootstrap-webpack and DllPlugin?
- Can I move bootstrap to a "dll" bundle with bootstrap-webpack and DllPlugin?
- expose vs providePlugin?
- Include custom themes HOT 2
- Update to webpack 2 HOT 1
- webpack2 , upgrade extract-text-webpack-plugin error HOT 6
- Webpack 2 error: Can't resolve './bootstrap-styles' & './bootstrap-scripts' HOT 4
- For us newbies, where do I put require("bootstrap-webpack"); HOT 2
- Webpack 2 - Cannot find module \babel-loader\lib\index.js??ref--8-0
- webpack4.x Webapck4 does not support 'extract-text-webpack-plugin' HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bootstrap-webpack.