node-sass-magic-importer icon indicating copy to clipboard operation
node-sass-magic-importer copied to clipboard

Not working with Webpack > 5.11

Open thecreazy opened this issue 3 years ago • 3 comments

With the 5.11.1 version of Webpack the importer made it go in an infinite loop if using the watch options, the isse reported from me at Webpack is there https://github.com/webpack/webpack/issues/12340

Fortunately webpack in the new version, thanks to the report, has added warnings in case of incorrect use of the addDependency for non-absolute paths

I created a repo where you can test the bug: https://github.com/thecreazy/webpack-bug-example-repo

the warnings displayed are the following:

Invalid dependencies have been reported by plugins or loaders for this module. All reported dependencies need to be absolute paths.
Invalid dependencies may lead to broken watching and caching.
As best effort we try to convert all invalid values to absolute paths and converting globs into context dependencies, but this is deprecated behavior.
Loaders: Pass absolute paths to this.addDependency (existing files), this.addMissingDependency (not existing files), and this.addContextDependency (directories).
Plugins: Pass absolute paths to fileDependencies (existing files), missingDependencies (not existing files), and contextDependencies (directories).
Globs: They are not supported. Pass absolute path to the directory as context dependencies.
The following invalid values have been reported:
 * "macros/*"
 * and more ...
 @ ./src/neewl/js/client.js 4:0-28

thecreazy avatar Jan 11 '21 08:01 thecreazy

+1

sainisagar310 avatar Jul 29 '21 18:07 sainisagar310

Updating to NextJS 12 and facing this issue because it is now using Webpack 5. Willing to contribute but I have no idea what should be done. Any guidance? What changed in Webpack that now requires paths to be absolute? I thought the associated includePaths option was meant to provide absolute search paths for these includes.

habovh avatar Dec 17 '21 14:12 habovh

Sorry to bump this but I saw that you opened a similar issue on another repository a few minutes after this one, and the solution was given: https://github.com/pmowrer/node-sass-json-importer/issues/96#issuecomment-778636748

Bumping sass-loader to sass-loader^11.0.1 in package.json seems to work for me, does it work in your test repository?

Should this issue be closed?

mpellegrin avatar Aug 22 '22 21:08 mpellegrin