codymikol / karma-webpack

Karma webpack Middleware
MIT License
830 stars 221 forks source link

Improve Error Message: Module not found: Error: Cannot resolve 'file' or 'directory' #112

Closed Kshirodram closed 3 years ago

Kshirodram commented 8 years ago

Hi There,

Can you guys please help me fixing this issue. I have two .jsx files one imported under another one. Lets say, A.jsx(Inside A.jsx I have imported the B.jsx) B.jsx

When both the files are written under same file in that case unit test cases working fine. The moment I am separating it out, still the component is working fine but the unit test cases are not running. Webpack karma throwing an error saying

ERROR in ./src/components/thpfooter/index.jsx Module not found: Error: Cannot resolve 'file' or 'directory' ./ThpFooterList in /Users/zi02/projects/creps_ui_components_library/src/components/thpfooter @ ./src/components/thpfooter/index.jsx 9:1725-1751

Thanks, Kshirodra

CrlsMrls commented 7 years ago

Hi @Kshirodram, could you resolve your problem? If not, could you add more information so we can reproduce it?

obenjiro commented 7 years ago

@Kshirodram

Read this

webpack: {
      // karma watches the test entry points
      // (you don't need to specify the entry option)
      // webpack watches dependencies

      // webpack configuration
    },

We have had and entry point defined and also got this weird error. I don't know why karma-webpack dons't say anything about that, and allow entry point definition. But it looks like this is exactly same error.

@carlos- Can you guys provide more meaningful error. Like look at the config and throw an error "DO NOT DEFINE ENTRY POINT AND RTFM!" :)

codymikol commented 3 years ago

Can you guys provide more meaningful error. Like look at the config and throw an error "DO NOT DEFINE ENTRY POINT AND RTFM!" :)

Hey, that is on my list here ==> https://github.com/ryanclark/karma-webpack/issues/475

if you're still interested in that, a v5 with this change should be coming in the next two weeks.