@ronanh seems like it can't find an image in resources/img/splash-image.png.
If you don't want to process CSS urls, you should add this to your webpack.mix.js file:
.options({
processCssUrls: false
});
Hi,
I am running into this npm error when trying to run "npm run dev". The issue only arrises when i try to include an image in one of my imported scss files that contains this scss i.e.:
.masthead { height: 60vh; min-height: 650px; background-image: url('../img/splash-image.png'); background-size: cover; background-position: center; background-repeat: no-repeat; }
Any ideas what is going on here?
@ dev /home/dev/MinFarm/webapp/mf-noc-ui npm run development
@ development /home/dev/MinFarm/webapp/mf-noc-ui cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
98% after emitting SizeLimitsPlugin
ERROR Failed to compile with 1 errors 12:32:02
This relative module was not found:
ERROR in ./resources/sass/app.scss Module build failed (from ./node_modules/css-loader/index.js): ModuleNotFoundError: Module not found: Error: Can't resolve '../img/splash-image.png' in '/home/dev/MinFarm/webapp/mf-noc-ui/resources/sass' at factory.create (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/webpack/lib/Compilation.js:925:10) at factory (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/webpack/lib/NormalModuleFactory.js:401:22) at resolver (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/webpack/lib/NormalModuleFactory.js:130:21) at asyncLib.parallel (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/webpack/lib/NormalModuleFactory.js:224:22) at /home/dev/MinFarm/webapp/mf-noc-ui/node_modules/neo-async/async.js:2830:7 at /home/dev/MinFarm/webapp/mf-noc-ui/node_modules/neo-async/async.js:6877:13 at normalResolver.resolve (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/webpack/lib/NormalModuleFactory.js:214:25) at doResolve (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/Resolver.js:213:14) at hook.callAsync (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/Resolver.js:285:5) at _fn0 (eval at create (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1) at resolver.doResolve (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:44:7) at hook.callAsync (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/Resolver.js:285:5) at _fn0 (eval at create (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1) at hook.callAsync (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/Resolver.js:285:5) at _fn0 (eval at create (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/tapable/lib/HookCodeFactory.js:33:10), :27:1) at resolver.doResolve (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43) at hook.callAsync (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/Resolver.js:285:5) at _fn43 (eval at create (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/tapable/lib/HookCodeFactory.js:33:10), :16:1) at hook.callAsync (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/Resolver.js:285:5) at _fn0 (eval at create (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/tapable/lib/HookCodeFactory.js:33:10), :27:1) at resolver.doResolve (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:67:43) at hook.callAsync (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/Resolver.js:285:5) at _fn1 (eval at create (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/tapable/lib/HookCodeFactory.js:33:10), :16:1) at hook.callAsync (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/Resolver.js:285:5) at _fn0 (eval at create (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/tapable/lib/HookCodeFactory.js:33:10), :15:1) at fs.stat (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/DirectoryExistsPlugin.js:27:15) at process.nextTick (/home/dev/MinFarm/webapp/mf-noc-ui/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:85:15) at _combinedTickCallback (internal/process/next_tick.js:131:7) at process._tickCallback (internal/process/next_tick.js:180:9) @ ./resources/sass/app.scss
ERROR in ./resources/sass/app.scss (./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/src??postcss0!./node_modules/resolve-url-loader??ref--5-4!./node_modules/sass-loader/dist/cjs.js??ref--5-5!./resources/sass/app.scss) Module not found: Error: Can't resolve '../img/splash-image.png' in '/home/dev/MinFarm/webapp/mf-noc-ui/resources/sass' @ ./resources/sass/app.scss (./node_modules/css-loader??ref--5-2!./node_modules/postcss-loader/src??postcss0!./node_modules/resolve-url-loader??ref--5-4!./node_modules/sass-loader/dist/cjs.js??ref--5-5!./resources/sass/app.scss) 7:136-170 @ ./resources/sass/app.scss
npm ERR! Linux 5.3.0-40-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "development"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! @ development: cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the @ development script 'cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /home/dev/MinFarm/webapp/mf-noc-ui/npm-debug.log
npm ERR! Linux 5.3.0-40-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "run" "dev"
npm ERR! node v8.10.0
npm ERR! npm v3.5.2
npm ERR! code ELIFECYCLE
npm ERR! @ dev: npm run development
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ dev script 'npm run development'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! npm run development
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request: npm ERR! /home/dev/MinFarm/webapp/mf-noc-ui/npm-debug.log
Thanks, Ronan
@ronanh seems like it can't find an image in resources/img/splash-image.png.
If you don't want to process CSS urls, you should add this to your webpack.mix.js file:
.options({
processCssUrls: false
});
Please or to participate in this conversation.