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"]
  },