Skip to content

Commit

Permalink
fix: prevent netlify dev from attempting to recursively call itself
Browse files Browse the repository at this point in the history
The CLI detects different framework commands in package.json, and will throw
if it detects `netlify dev` in the default script while running `netlify dev`
in order to avoid recursively calling itself.

By removing the `netlify dev` from the `start` and `dev` scripts and adjusting
the CLI logic to recognize `netlify dev:exec` as distinct from `netlify:dev`,
we can get this project working as expected.

Also updates package.json dependencies.

see also:
netlify#26
netlify/cli#1798
  • Loading branch information
ctjlewis committed Jan 24, 2021
1 parent 159b95d commit dde0286
Show file tree
Hide file tree
Showing 5 changed files with 22,715 additions and 7,716 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# See https://help.github.com/ignore-files/ for more about ignoring files.

# .env
.env

# eslint cache
.eslintcache

# dependencies
/node_modules

Expand Down
32 changes: 17 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ Example of using [FaunaDB](https://fauna.com/) with [Netlify functions](https://
<details>
<summary>Expand Table of Contents</summary>

- [About this application](#about-this-application)
- [Setup &amp; Run Locally](#setup--run-locally)
- [TLDR; Quick Deploy](#tldr-quick-deploy)
- [Tutorial](#tutorial)
* [Background](#background)
* [1. Create React app](#1-create-react-app)
* [2. Set up FaunaDB](#2-set-up-faunadb)
* [3. Create a function](#3-create-a-function)
+ [Anatomy of a Lambda function](#anatomy-of-a-lambda-function)
+ [Setting up functions for local development](#setting-up-functions-for-local-development)
* [4. Connect the function to the frontend app](#4-connect-the-function-to-the-frontend-app)
* [5. Finishing the backend Functions](#5-finishing-the-backend-functions)
* [Wrapping Up](#wrapping-up)
- [Netlify + FaunaDB &nbsp;&nbsp;&nbsp;<a href="https://app.netlify.com/start/deploy?repository=https://github.com/netlify/netlify-faunadb-example&stack=fauna"><img src="https://www.netlify.com/img/deploy/button.svg"></a>](#netlify--faunadb-)
- [About this application](#about-this-application)
- [Deploy with one click](#deploy-with-one-click)
- [Setup & Run Locally](#setup--run-locally)
- [TLDR; Quick Deploy](#tldr-quick-deploy)
- [Tutorial](#tutorial)
- [Background](#background)
- [1. Create React app](#1-create-react-app)
- [2. Set up FaunaDB](#2-set-up-faunadb)
- [3. Create a function](#3-create-a-function)
- [Anatomy of a Lambda function](#anatomy-of-a-lambda-function)
- [Setting up functions for local development](#setting-up-functions-for-local-development)
- [4. Connect the function to the frontend app](#4-connect-the-function-to-the-frontend-app)
- [5. Finishing the backend Functions](#5-finishing-the-backend-functions)
- [Wrapping Up](#wrapping-up)

</details>
<!-- AUTO-GENERATED-CONTENT:END -->
Expand Down Expand Up @@ -96,10 +98,10 @@ Click the [Deploy to Netlify Button](https://app.netlify.com/start/deploy?reposi
npm run bootstrap
```

10. Run project locally
10. Start developing!

```bash
npm start
netlify dev
```

## TLDR; Quick Deploy
Expand Down
4 changes: 2 additions & 2 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
publish = "build"

[dev]
# Local dev command. A.k.a npm start
command = "react-scripts start"
# Call react-scripts start
command = "npm start"
Loading

0 comments on commit dde0286

Please sign in to comment.