I am having the same issue too, with the latest sage, 9.0.10
When my css is set to a full, external path, with no quotation marks, my yarn: build or yarn start (watching), complies correctly. Such as:
.next-icon {
background: url(https://carryonwebsite.s3.amazonaws.com/files/arrow-right-thin-white.png) no-repeat
center; }
This works, but not with local images I want to use, I have to upload to Amazon S3 and format as above.
=======
But if I do it any other way as a relative path (with single quotes, double quotes, or no quotes), I get this error:
With the relative path and single or double quotes, such as:
background: url('../images/arrow-left-thin-white.png') no-repeat center;
I get
This relative module was not found:
* ./images/arrow-left-thin-white.png in ./node_modules/cache-loader/dist/cjs.js!./node_modules/css-
loader?{"sourceMap":true}!./node_modules/postcss-loader/dist/cjs.js?{"postcssOptions":
{"path":"/Users/mikey/Local Sites/crack-the-
sky/app/bedrock/web/app/themes/sage/resources/assets/build","ctx":
{"open":true,"copy":"images/**/*","proxyUrl":"http://localhost:3000","cacheBusting":"[name]_[hash:8]","paths":
{"root":"/Users/mikey/Local Sites/crack-the-
sky/app/bedrock/web/app/themes/sage","assets":"/Users/mikey/Local Sites/crack-the-
sky/app/bedrock/web/app/themes/sage/resources/assets","dist":"/Users/mikey/Local Sites/crack-the-
sky/app/bedrock/web/app/themes/sage/dist"},"enabled":
{"sourceMaps":true,"optimize":false,"cacheBusting":false,"watcher":true},"watch":
["app/**/*.php","config/**/*.php","resources/views/**/*.php"],"entry":{"main":
["./scripts/main.js","./styles/main.scss"],"customizer":["./scripts/customizer.js"],"fitvids":
["./scripts/fitvids.js"]},"publicPath":"/app/themes/sage/dist/","devUrl":"http://crack-the-sky.local","env":
{"production":false,"development":true},"manifest":{}}},"sourceMap":true}!./node_modules/resolve-url-
loader?{"sourceMap":true}!./node_modules/sass-loader/lib/loader.js?
{"sourceMap":true,"sourceComments":true}!./node_modules/import-
glob!./resources/assets/styles/main.scss
or with no quotes, and just as is in the Sage documentation
background: url(../images/arrow-left-thin-white.png) no-repeat center;
I get this error:
Module build failed: ModuleNotFoundError: Module not found: Error: Can't resolve './images/arrow-left-
thin-white.png' in '/Users/mikey/Local Sites/crack-the-
sky/app/bedrock/web/app/themes/sage/resources/assets/styles'
at factoryCallback (/Users/mikey/Local Sites/crack-the-
sky/app/bedrock/web/app/themes/sage/node_modules/webpack/lib/Compilation.js:276:40)
at factory (/Users/mikey/Local Sites/crack-the-
sky/app/bedrock/web/app/themes/sage/node_modules/webpack/lib/NormalModuleFactory.js:235:20)
at resolver (/Users/mikey/Local Sites/crack-the-
sky/app/bedrock/web/app/themes/sage/node_modules/webpack/lib/NormalModuleFactory.js:60:20)
at asyncLib.parallel (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/webpack/lib/NormalModuleFactory.js:127:20)
at /Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/async/dist/async.js:3888:9
at /Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/async/dist/async.js:473:16
at iteratorCallback (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/async/dist/async.js:1062:13)
at /Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/async/dist/async.js:969:16
at /Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/async/dist/async.js:3885:13
at resolvers.normal.resolve (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/webpack/lib/NormalModuleFactory.js:119:22)
at onError (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/Resolver.js:65:10)
at loggingCallbackWrapper (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at runAfter (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/Resolver.js:158:4)
at innerCallback (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/Resolver.js:146:3)
at loggingCallbackWrapper (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at next (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/tapable/lib/Tapable.js:252:11)
at /Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/UnsafeCachePlugin.js:40:4
at loggingCallbackWrapper (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at runAfter (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/Resolver.js:158:4)
at innerCallback (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/Resolver.js:146:3)
at loggingCallbackWrapper (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at next (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/tapable/lib/Tapable.js:252:11)
at innerCallback (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/Resolver.js:144:11)
at loggingCallbackWrapper (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at next (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/tapable/lib/Tapable.js:249:35)
at resolver.doResolve.createInnerCallback (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/DescriptionFilePlugin.js:44:6)
at loggingCallbackWrapper (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at afterInnerCallback (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/Resolver.js:168:10)
at loggingCallbackWrapper (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/enhanced-resolve/lib/createInnerCallback.js:31:19)
at next (/Users/mikey/Local Sites/crack-the-sky/app/bedrock/web/app/themes/sage/node_modules/tapable/lib/Tapable.js:252:11)