Skip to content

Start entire app using npm start #26

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

Merged
merged 4 commits into from
Aug 1, 2019
Merged

Start entire app using npm start #26

merged 4 commits into from
Aug 1, 2019

Conversation

itaisteinherz
Copy link
Contributor

No description provided.

@itaisteinherz
Copy link
Contributor Author

Let me know if you think I should remove the documentation about the individual commands and merge it into the new documentation (about running everything concurrently) or keep things the way they are.

@itaisteinherz
Copy link
Contributor Author

Sidenote: when running $ yarn start:app, I get the following error:

❯ yarn start
yarn run v1.16.0
$ react-scripts start

There might be a problem with the project dependency tree.
It is likely not a bug in Create React App, but something you need to fix locally.

The react-scripts package provided by Create React App requires a dependency:

  "webpack": "4.29.6"

Don't try to install it manually: your package manager does it automatically.
However, a different version of webpack was detected higher up in the tree:

  /create-react-app-lambda/node_modules/webpack (version: 4.19.1)

Manually installing incompatible versions is known to cause hard-to-debug issues.

If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That will permanently disable this message but you might encounter other issues.

To fix the dependency tree, try following the steps below in the exact order:

  1. Delete package-lock.json (not package.json!) and/or yarn.lock in your project folder.
  2. Delete node_modules in your project folder.
  3. Remove "webpack" from dependencies and/or devDependencies in the package.json file in your project folder.
  4. Run npm install or yarn, depending on the package manager you use.

In most cases, this should be enough to fix the problem.
If this has not helped, there are a few other things you can try:

  5. If you used npm, install yarn (http://yarnpkg.com/) and repeat the above steps with it instead.
     This may help because npm has known issues with package hoisting which may get resolved in future versions.

  6. Check if /create-react-app-lambda/node_modules/webpack is outside your project directory.
     For example, you might have accidentally installed something in your home folder.

  7. Try running npm ls webpack in your project folder.
     This will tell you which other package (apart from the expected react-scripts) installed webpack.

If nothing else helps, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project.
That would permanently disable this preflight check in case you want to proceed anyway.

P.S. We know this message is long but please read the steps above :-) We hope you find them helpful!

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

And so I uninstalled babel-loader, which seemed to fix the issue. Should I remove the package from here as well (either in this PR or in a separate one)?

@swyxio
Copy link
Contributor

swyxio commented Jun 1, 2019

ok could you remove babel loader too? thanks

@itaisteinherz
Copy link
Contributor Author

@sw-yx Done 👌🏻
Will users still be able to use function builder detection despite the start npm script now running both the frontend app and netlify-lambda? From the docs, it seems like the feature should still work, though now they'll have to set command="yarn start:app" in netlify.toml.

Copy link
Contributor

@swyxio swyxio left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just saw this. yes, they can use function builder detevtion. thank you!

@swyxio swyxio merged commit e4d0054 into netlify:master Aug 1, 2019
@itaisteinherz itaisteinherz deleted the patch-1 branch August 2, 2019 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants