Skip to content
This repository has been archived by the owner on Jul 27, 2021. It is now read-only.

Not showing the real missing module #14

Open
egoist opened this issue Dec 31, 2016 · 5 comments
Open

Not showing the real missing module #14

egoist opened this issue Dec 31, 2016 · 5 comments

Comments

@egoist
Copy link

egoist commented Dec 31, 2016

2016-12-31 4 32 55

here I miss-spelled postcss-loader to postcss-loadedr, and use it with stylus-loader to import some .styl file, can we have the error log showing the real missing module inseatd of b.styl?

@dealloc
Copy link

dealloc commented Feb 8, 2017

I encountered the same issue with sass-loader, it's rather frustrating when being pointed in the wrong direction regarding errors

@geowarin
Copy link
Owner

geowarin commented Feb 8, 2017

Could you provide a repro, or even better contribute a test via a PR?
Thats would help me a great deal to fix this issue!

@dealloc
Copy link

dealloc commented Feb 8, 2017

Well, I am using the vue webpack template, here are the steps I found to reproduce the issue:

  • install the template (vue init webpack friendly-errors-demo) (just follow the wizard to complete)
  • open the file src/components/Hello.vue and change the style tag from this
<style scoped>
...
</style>

to this

<style scoped lang="scss">
...
</style>

which should trigger something like this:
1486584015

A slightly more advanced reproduction, but with a clearer demonstration of the error would be if you create a separate scss file and attempt to import that, which results in something like below:
1486584111

as you can see, on the left the plugin tells me that there's a problem with the import of ./style.scss while the browser clearly shows that it's sass-loader not being found causing the problem.

Hope that helps, if you need more info let me know

@dmnrmr
Copy link

dmnrmr commented Jul 2, 2018

Any progress on this?

@donnysim
Copy link

donnysim commented Sep 3, 2018

Just encountered this, from my debugging:

function isModuleNotFoundError (e) {
  const webpackError = e.webpackError || {};
  return webpackError.dependencies
    && webpackError.dependencies.length > 0
    && e.name === 'ModuleNotFoundError'
    && e.message.indexOf('Module not found') === 0;
}

it's not e.name === 'ModuleNotFoundError' it's webpackError.name === 'ModuleNotFoundError'.
Though it gets glued up at the top with other output, while the details are at the very bottom.

top

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

No branches or pull requests

5 participants