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

Provide useful messages for missing files #96

Closed
gaearon opened this issue Jul 22, 2016 · 6 comments
Closed

Provide useful messages for missing files #96

gaearon opened this issue Jul 22, 2016 · 6 comments

Comments

@gaearon
Copy link
Contributor

gaearon commented Jul 22, 2016

  • index.html
  • favicon.ico
  • src/index.js

They are all required, and we should crash early with a descriptive message if they are not found.

(Probably we could make favicon optional but then it would be hard to guess where to put it. I see no harm in forcing it to be there since any real website needs it anyway.)

@apoorvnandan
Copy link

Hey, I would like to work on this but I need some guidance. Will using npm file-exists before opening the browser do the job?

var fileExists = require('file-exists');
if (!fileExists("/index.html") || !fileExists("/favicon.ico") || !fileExists("/src/index.html")) {
  console.log("File missing");
}
else {
  console.log(chalk.cyan('Starting the development server...'));
  openBrowser();
}

@gaearon
Copy link
Contributor Author

gaearon commented Jul 22, 2016

I would suggest to try implementing something that works and feels good. When we get the right UX we can choose to make changes to the actual implementation.

@christophior
Copy link

Might take a look at this as well, I see that we already have paths that we're getting in the webpack configs so I was thinking of pulling those out since a lot of it seems like redundant data so that I could also use that in checking whether the required files exist.

@vincaslt
Copy link

I guess something like that could work, tell me if it should be improved. Maybe move required file definitions to somewhat more manageable place?

@delorge
Copy link

delorge commented Aug 3, 2016

Is it easier to check that file exists via access check? Should work with any npm version. Moreover, no extra dependencies needed.

UPD: we can basically crash on errors and warn on missing favicon

@gaearon
Copy link
Contributor Author

gaearon commented Sep 18, 2016

This should be fixed in 0.4.2.

@gaearon gaearon closed this as completed Sep 30, 2016
grengojbo pushed a commit to grengojbo/es6-react-scripts that referenced this issue Nov 18, 2017
add various missing =true in README.md
@lock lock bot locked and limited conversation to collaborators Jan 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants