Skip to content

Better error messages #57

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

Open
Psykar opened this issue Mar 6, 2017 · 3 comments
Open

Better error messages #57

Psykar opened this issue Mar 6, 2017 · 3 comments

Comments

@Psykar
Copy link
Contributor

Psykar commented Mar 6, 2017

throw new Error('CSS module import does not exist.');

Should put the name that fails here, otherwise you have to check each styleName manually.

@Psykar
Copy link
Contributor Author

Psykar commented Mar 6, 2017

Maybe not required - these are very early import messages, not after the file is parsed, and in my case were due to screwing up my config ( #58 )
Might still be useful - but if you disagree and close, I won't be fussed :)

@gajus gajus changed the title [enhancement] - Better error messages Better error messages Mar 6, 2017
@mzvonar
Copy link

mzvonar commented Jun 28, 2017

Yes, that would be really helpful. It would be much easier to find missing class

@NE-SmallTown
Copy link

NE-SmallTown commented Sep 9, 2017

const filename = stats.file.opts.filename;
const targetFileDirectoryPath = dirname(stats.file.opts.filename);

here we can add

if (stats.opts.debug) { // provide a new option debug
  console.log(`at ${filename} import:`);
  console.log(targetResourcePath);
  console.log(`the resource link we use is: ${path.node.source.value}`);
}

if (stats.opts.webpackHotModuleReloading) {
addWebpackHotModuleAccept(path);
}

and here we can add:

if (stats.opts.debug) {
  console.log(`after process the import the filenameMap[${filename}].styleModuleImportMap is:  ` + JSON.stringify(filenameMap[filename].styleModuleImportMap) + '\n');
}

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

4 participants