Cannot find module "../maps/decode.json"
See original GitHub issueAfter searching for a framework to replace the popular Draftjs, I stumbled upon Slate. I started reading the docs, and tried to create a basic Slate example. I copied the basic example from this page of the docs. After creating a new React component in my local environment and pasting in that code, I was presented with the following error:
Cannot find module "../maps/decode.json"
I have no idea what this means. I don’t know if the issue is with Webpack or Slate; however, I’m leaning more towards the former.
I think the best way for you to understand what’s going on is to try it yourself. I created a temporary Github repo with my attempt to create the simple Slate example. It’s really small, just a simple React boilerplate.
To recreate this error:
- Download or clone my repo’s directory to your computer.
- Install the dependencies with
npm install
- Run the Express server with
npm start
- Navigate to
localhost:3000
I appreciate your time and look forward to a response. Can’t wait to use this awesome framework, appreciate you open sourcing it.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (5 by maintainers)
Top GitHub Comments
It works! Thanks, guys. I can’t wait to start building my editor 😃
Just for those who may encounter the same error:
All you have to do is install
json-loader
and add the following object to the loaders array within the Webpack config:I ran into this issue as well, with an additional complication of having the
initialState.json
for the editor in thesrc
folder. Here is the solution that worked for me (enhancement to the one mentioned above), incase anyone else encounters it.In my case, the initial problem was being created via cheerio, so hopefully, it will completely disappear with #55 or upgrade to webpack 2.0.