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

[V4] webpack5 sets devtool to false, and an error is reported #214

Open
imcamo opened this issue Aug 2, 2021 · 2 comments
Open

[V4] webpack5 sets devtool to false, and an error is reported #214

imcamo opened this issue Aug 2, 2021 · 2 comments

Comments

@imcamo
Copy link

imcamo commented Aug 2, 2021

ERROR in ./resources/assets/pages/auth/lottery/lottery.css
Module build failed (from ./node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/resolve-url-loader/index.js):
Error: resolve-url-loader: error processing CSS
a valid source-map is not present (ensure preceding loaders output a source-map)
at file://E:\code\m-soa\resources\assets\pages\auth\lottery\lottery.css:1:57
at encodeError (E:\code\m-soa\node_modules\resolve-url-loader\index.js:274:12)
at onFailure (E:\code\m-soa\node_modules\resolve-url-loader\index.js:215:14)
at processResult (E:\code\m-soa\node_modules\webpack\lib\NormalModule.js:703:19)
at E:\code\m-soa\node_modules\webpack\lib\NormalModule.js:809:5
at E:\code\m-soa\node_modules\loader-runner\lib\LoaderRunner.js:399:11
at E:\code\m-soa\node_modules\loader-runner\lib\LoaderRunner.js:251:18
at context.callback (E:\code\m-soa\node_modules\loader-runner\lib\LoaderRunner.js:124:13)
at onFailure (E:\code\m-soa\node_modules\resolve-url-loader\index.js:215:5)

@bholloway
Copy link
Owner

Firstly check you have {sourceMap: true} from sass-loader as shown here. I know this may be obvious but it's often overlooked.

Assuming that is not the problem, please provide a minimum breaking example as an OSS repo.

@Tobbe
Copy link

Tobbe commented Jul 27, 2023

Came here to say I was seeing the same thing. Setting devtool to 'source-map' made resolve-url-loader work, and setting devtool to false gave that error message about source maps.

But @bholloway was correct. It's the sourceMap option that's important.
We have a pretty complex setup with postcss-loader, sass-loader and css-loader used in different combination for different scenarios. I had just forgotten to set sourceMap: true on one of the postcss-loader configs 🙂

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

No branches or pull requests

3 participants