node-sass-magic-importer
node-sass-magic-importer copied to clipboard
Not working with Webpack > 5.11
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
+1
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.
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?