Skip to content

Commit dde0286

Browse files
committed
fix: prevent netlify dev from attempting to recursively call itself
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
1 parent 159b95d commit dde0286

File tree

5 files changed

+22715
-7716
lines changed

5 files changed

+22715
-7716
lines changed

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# See https://help.github.com/ignore-files/ for more about ignoring files.
22

3+
# .env
4+
.env
5+
6+
# eslint cache
7+
.eslintcache
8+
39
# dependencies
410
/node_modules
511

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,21 @@ Example of using [FaunaDB](https://fauna.com/) with [Netlify functions](https://
66
<details>
77
<summary>Expand Table of Contents</summary>
88

9-
- [About this application](#about-this-application)
10-
- [Setup &amp; Run Locally](#setup--run-locally)
11-
- [TLDR; Quick Deploy](#tldr-quick-deploy)
12-
- [Tutorial](#tutorial)
13-
* [Background](#background)
14-
* [1. Create React app](#1-create-react-app)
15-
* [2. Set up FaunaDB](#2-set-up-faunadb)
16-
* [3. Create a function](#3-create-a-function)
17-
+ [Anatomy of a Lambda function](#anatomy-of-a-lambda-function)
18-
+ [Setting up functions for local development](#setting-up-functions-for-local-development)
19-
* [4. Connect the function to the frontend app](#4-connect-the-function-to-the-frontend-app)
20-
* [5. Finishing the backend Functions](#5-finishing-the-backend-functions)
21-
* [Wrapping Up](#wrapping-up)
9+
- [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-)
10+
- [About this application](#about-this-application)
11+
- [Deploy with one click](#deploy-with-one-click)
12+
- [Setup & Run Locally](#setup--run-locally)
13+
- [TLDR; Quick Deploy](#tldr-quick-deploy)
14+
- [Tutorial](#tutorial)
15+
- [Background](#background)
16+
- [1. Create React app](#1-create-react-app)
17+
- [2. Set up FaunaDB](#2-set-up-faunadb)
18+
- [3. Create a function](#3-create-a-function)
19+
- [Anatomy of a Lambda function](#anatomy-of-a-lambda-function)
20+
- [Setting up functions for local development](#setting-up-functions-for-local-development)
21+
- [4. Connect the function to the frontend app](#4-connect-the-function-to-the-frontend-app)
22+
- [5. Finishing the backend Functions](#5-finishing-the-backend-functions)
23+
- [Wrapping Up](#wrapping-up)
2224

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

99-
10. Run project locally
101+
10. Start developing!
100102

101103
```bash
102-
npm start
104+
netlify dev
103105
```
104106

105107
## TLDR; Quick Deploy

netlify.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
publish = "build"
77

88
[dev]
9-
# Local dev command. A.k.a npm start
10-
command = "react-scripts start"
9+
# Call react-scripts start
10+
command = "npm start"

0 commit comments

Comments
 (0)