Comments (19)
When using
"serve": "firebase serve --port 5000 --only functions,hosting"
you must wait this line:
i hosting: Serving hosting files from: build/public
✔ hosting: Local server: http://localhost:5000
✔ functions: next: http://localhost:5001/<Project-name>/us-central1/next
Node: v7.4.0
Yarn: 0.27.5
from firebase-functions-next-example.
Solved it! Try this:
"serve": "firebase serve --port 5000 --only hosting"
instead of:
"serve": "firebase serve --port 5000 --only hosting,functions"
I noticed that when I used "serve": "firebase serve"
the console output did say anything about functions.
It seems that the rewrite
rule in firebase.json
does everything required to host the functions without us needing to specify anything.
from firebase-functions-next-example.
See this repo => https://github.com/Bolket/next-firebase-functions/tree/development
from firebase-functions-next-example.
I like what you did including ES6+ transpiling with the nice folder structure too. I avoided that with this repo since I wanted to keep it as bare bones as possible so people who haven't read my other posts aren't lost. It gets complex pretty quickly. I'll be AFK for the next 12 hours, so hopefully, this solves your problems for now.
from firebase-functions-next-example.
i have fixed the problem with var app = next({ dev: false, conf: { distDir: "next" } })
from firebase-functions-next-example.
have you problem with var app = next({ dev: true, conf: { distDir: "next" } })
???
I think that we must be increase the timeout of the cloud function...
@jthegedus
from firebase-functions-next-example.
Hi @sarovin, I don't have any errors with either {dev: true,
or {dev: false,
.
Can you post your pkg.json files?
I found some other issues when using versions of packages <
these:
"firebase-admin": "^5.0.1",
"firebase-functions": "^0.6.0",
"next": "beta",
from firebase-functions-next-example.
i have the same versions...
from firebase-functions-next-example.
Are you producing this error on a clone of this repo or have you modified things? Because I can't reproduce the error. I didn't even know that you could Timeout locally served Firebase Functions! I've asked some q's on the Firebase community Slack channel to see if a Firebaser can advise on this error.
To be clear, you got it to work fine with dev:false
, but dev:true
throws that same error you originally posted?
from firebase-functions-next-example.
@i have changed the serve script with this "serve": "firebase serve --port 5000 --only functions,hosting",
If i use only firebase serve
i have this error:
Error: NOT_FOUND
my firebase-tools version is 3.9.2...
from firebase-functions-next-example.
I'm also using that version of firebase-tools
. This leads me to believe there is some other issue going on here because you should be able to just use firebase serve
.
When using
"serve": "firebase serve --port 5000 --only functions,hosting",
I had this console output
and the browser showed this error
internal error occurred while connecting to Cloud Function "next"
But with just
"serve: "firebase serve"
I did not have the error functions: Cannot start emulator. Error: Cannot find module '@google-cloud...
in the console and the page is hosted correctly.
Maybe this is a Node or Yarn version issue? I've got:
Node: v6.11.1
Yarn: 0.27.5
Failing that, I imagine solving the issue with using firebase serve
may fix this issue. You should be able to use it just fine so something is amiss there.
from firebase-functions-next-example.
That line only shows once I attempt to load the page. I still get an error asking for the Google Cloud Function emulator.
and the page errors of course.
The google-cloud/functions-emulator
may be causing interference with firebase serve
if it's also a global package.
from firebase-functions-next-example.
i don't understand...you not serve the functions???
from firebase-functions-next-example.
It seems that when you deploy Firebase Hosting with a Rewrite rule in the firebase.json
it knows that there is a function and handles serving the function for you.
from firebase-functions-next-example.
and if i not deploy
but run only serve
?
@jthegedus My goal is running nextjs app in development mode in localhost
from firebase-functions-next-example.
Yes.
So when you run firebase deploy
, it deploys both the Cloud Function and the Hosting. When you run firebase serve
it serves the Hosting, but part of that configuration involves a Cloud Function so it serves the ones it needs behind the scenes.
Try this:
"serve": "firebase serve --port 5000 --only hosting"
it works.
from firebase-functions-next-example.
...i have tested with "serve": "firebase serve --port 5000 --only hosting"
but i have the same issue:
i hosting: Serving hosting files from: src/public
✔ hosting: Local server: http://localhost:5000
127.0.0.1 - - [08/Aug/2017:15:34:35 +0000] "GET / HTTP/1.1" 404
from firebase-functions-next-example.
Interesting. This may be a config problem in your firebase.json
file. Do you mind sharing? If you can't share here you could add me as a read-only user to your repo.
from firebase-functions-next-example.
Bolket/next-firebase-functions#3
So I removed your slasher
wrapper for your Cloud Function and it works fine now. Since you're rewriting all routes with **/**
in the firebase.json
every route without a /
will end up at the Next.js app. Next.js already handles the issues around missing /
s. You can still use the slasher
wrapper for any other Cloud Functions you may create.
When your code was deployed it appeared to work fine, however, it was actually doing a full refresh of each route from the Next.js server instead of client-side caching (a part of Next.js). Removing the slasher
from this Cloud Function fixed this issue too.
from firebase-functions-next-example.
Related Issues (20)
- inconsistent information HOT 3
- Get a mate with a Windows machine to test this repo
- Add SCSS/SASS import HOT 3
- how to user a custom HTML template for render HOT 4
- Integrate firebase realtime database example HOT 3
- Native Windows support HOT 6
- Cache-Control HOT 2
- style jsx doesn't work on firebase but does on local dev server HOT 2
- Why the projcet dont have a <Head> component? HOT 1
- Cannot find module 'babel-runtime/regenerator' HOT 7
- Error: Cannot find module '/user_code/next/server/pages-manifest.json' HOT 6
- Anyone had any luck with firebase functions on node 8 and next 6.1 HOT 3
- @google-cloud/functions-emulator | Suggested Solution HOT 2
- Image assets HOT 3
- Working with service worker offline HOT 1
- Incorporating Firebase Auth HOT 1
- 'NODE_ENV' is not recognized as an internal or external command HOT 1
- Unexpected identifier prepare() on function deploy HOT 1
- not working on new versions of nextjs 4 and react 16 HOT 11
- Can not deploy when dev = false HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from firebase-functions-next-example.