tehsis/normalize

Module not found: Error: Cannot resolve 'file' or 'directory' ./charmap

Closed this issue · 4 comments

I keep getting this error when trying to use this module in my react application. Please help

This is a problem I've seen before. node allows you to import './charmap' while webpack requires you to import './charmap.json'

A potential fix would be to just change the require statments to be compatible with webpack, I think it's a bit more clear anyways.

cslee commented

webpack's config allows you to specify the extensions to resolve, so you can add '.json' there.

https://webpack.js.org/configuration/resolve/#resolve-extensions

How about React or Angular, where without ejecting the configuration you don't get straight forward access to the Webpack config? This should really be solved here, by correcting the import to specify the file extension explicitly as charmap.json. However, looks like this repo has been abandoned. There are two PRs open to fix this simple issue that has a severe impact, which have sadly gone ignored.

Resolved by #7