Skip to content

Commit

Permalink
Fix serve command (vercel#3989)
Browse files Browse the repository at this point in the history
* Fix serve command

From the Firebase docs, you must use --only in order to run the local function emulator.
See https://firebase.google.com/docs/functions/local-emulator

* Add production env for firebase serve

Doesn't work without this

* Update text as suggested by @jthegedus
  • Loading branch information
jonjamz authored and timneutkens committed Mar 31, 2018
1 parent bd50a7c commit b39958e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
8 changes: 2 additions & 6 deletions examples/with-firebase-hosting/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,9 @@ npm run dev

#### Run Firebase locally for testing:

Unfortunately I have been unable to get any combination of

```bash
firebase serve --only functions,hosting
```

to locally host the built Next.js app as expected. [This issue is where solutions are being explored](https://github.com/firebase/firebase-tools/issues/535) and they will be shared here and on the [Next.js repo's similar issue](https://github.com/zeit/next.js/issues/3167) when discovered.
npm run serve
```

#### Deploy it to the cloud with Firebase:

Expand Down
2 changes: 1 addition & 1 deletion examples/with-firebase-hosting/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"description": "Host Next.js SSR app on Firebase Cloud Functions with Firebase Hosting redirects.",
"scripts": {
"dev": "next src/app",
"serve": "echo \"for details see:\n\thttps://github.com/firebase/firebase-tools/issues/535 \n\thttps://github.com/zeit/next.js/issues/3167\";",
"serve": "NODE_ENV=production firebase serve --only functions,hosting",
"deploy": "firebase deploy",
"clean": "rimraf \"dist/functions\" && rimraf \"dist/public\"",
"build-public": "cpx \"src/public/**/*.*\" \"dist/public\" -C",
Expand Down

0 comments on commit b39958e

Please sign in to comment.