Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '../data' #9

Open
sravanisomepalli6 opened this issue Aug 8, 2017 · 1 comment
Open

Cannot find module '../data' #9

sravanisomepalli6 opened this issue Aug 8, 2017 · 1 comment

Comments

@sravanisomepalli6
Copy link

sravanisomepalli6 commented Aug 8, 2017

Cannot find module '../data' (const Heroes = require('../data');)

when using npm start i am getting this error plz help

@sirockin
Copy link

I've had the same problem when following the tutorial. It seems to be caused by the fact that the build script does not copy data.json from src to dist. (This repo currently includes /dist/data.json in there so it gets round the problem but this means there are now two files to maintain).

A better solution would be one of the following:

  1. Move data.json into the root of the project and change the reference to '../../data' (better still a subdirectory of the root)
  2. Amend the build script so it copies data.json from src into the dist directory

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants