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
Module build failed: Error: Something wrong with provided resources. Make sure 'options.resources' is String or Array of Strings. #38
Comments
Getting the same with Webpack 2.6 |
More at this issue 40 |
I believe this can be closed. |
the path in options.resources must be a absolute path, eg: path.resolve is needed,good lucky! |
using absolute path still get the error |
@pangz1 any chance that you can dig into this. If a PR is needed, I'll review. |
This error can be misleading. It says that the resources array is empty in config, but really there can be just zero files resolved by |
Ok, I think this error should be turned into warning, and before it there should be another check. I made a PR of my thoughts, feel free to add any comments and change it. |
@dkaraush I think your solution might bring more confusion, although I do agree that this should be a non-fatal error. Something like so: if (isArrayOfStrings(locations)) {
logger.debug('options.resources is Array of Strings:', true);
return locations.reduce((resolvedFiles, directory) => {
const files = glob.sync(directory);
if (files.length === 0) {
logger.warn(`
Couldn't find any files under the ${directory} directory.
Did you forget to resolve this to an absolute path with path.resolve?
`);
}
return [...resolvedFiles, ...files];
}, []);
} Let me know what you think @justin808 & @dkaraush. |
Yes, I agree with you, that would be much more clear. But keep in mind that single string can also bring an empty array of files. |
I like what @Tomburgs said, but I think the error should be fatal, as warnings might be ignored. |
Done. Have a look at #134 @justin808 & @dkaraush! |
The plugin throws error with webpack 3.1.0
Upon debugging webpack, it appears
sass-resources-loader\lib\utils\parseResources.js
line 34 is returning blank. Glob.sync is not returning the absolute path. So insass-resources-loader\lib\loader.js
line 54,var resourcesLocations
is set to emptyThe text was updated successfully, but these errors were encountered: