Fixing webpack error: ERROR in Entry module not found: Error: Cannot resolve ‘file’ or ‘directory’ ./src/ssl_search/Entry.js in D:\projects\image-annotation

If you try to set up the “resolve” part of webpack, you can start getting errors finding files that clearly exist:

ERROR in Entry module not found: Error: Cannot resolve 'file' or 'directory' ./src/ssl_search/Entry.js in D:\projects\image-annotation

This will happen if you set up resolve like so:

  resolve: {
    extensions: [".tsx", ".ts", ".jsx", ".js"]
  },

What is happening is that the resolver is creating a virtual filesystem, and filtering the contents of a directory with these. Since folders don’t normally have extensions, they are removed. To fix this, you need the following:

  resolve: {
    extensions: ["", ".tsx", ".ts", ".jsx", ".js"]
  },

Interested in JavaScript? I send out weekly, personalized emails with articles and conference talks. Click here to see an example and subscribe.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *