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
FIX deploy with-firebase-hosting #3946
Conversation
@@ -7,7 +7,8 @@ | |||
"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\";", | |||
"deploy": "firebase deploy", | |||
"predeploy": "mkdir -p \"dist/functions\"", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We shouldn't need this as build-funcs
will create this when run.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but we must run firebase deploy
in dist/functions
for fix the problem. If i run yarn clean
and after cd \"dist/functions\" && firebase deploy
, we have an error because dist/functions
not exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cd "dist/functions" && firebase deploy
It errors because after you cd
into dist/functions
firebase deploy
tries to deploy a directory called dist/functions
which doesn't exist from the relative directory of dist/functions
.
firebase deploy
knows to deploy dist/functions
from https://github.com/zeit/next.js/pull/3946/files#diff-0bde36a03f5abc11a925591823b9d3c2R13
@@ -7,7 +7,8 @@ | |||
"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\";", | |||
"deploy": "firebase deploy", | |||
"predeploy": "mkdir -p \"dist/functions\"", | |||
"deploy": "cd \"dist/functions\" && firebase deploy", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and this shouldn't be required either because https://github.com/zeit/next.js/blob/76582b8e437dadc4dce18ec6ee525acb6f0d2cdb/examples/with-firebase-hosting/firebase.json#L13 should be picked up on firebase deploy
.
And moving dir might mess up the deployment step of any hosting or db parts of the deployment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why...but this doesn't work for me...
In the last update I added Firebase Deployment Hooks https://github.com/zeit/next.js/blob/76582b8e437dadc4dce18ec6ee525acb6f0d2cdb/examples/with-firebase-hosting/firebase.json#L10 and https://github.com/zeit/next.js/blob/76582b8e437dadc4dce18ec6ee525acb6f0d2cdb/examples/with-firebase-hosting/firebase.json#L15 so you shouldn't need to create any folders as they are created on the output of the @sarovin could you please double check and post your Node version, the version of |
@sarovin Oh, I think the issue may be because I didn't change the predeploy hooks to use npm. I use Yarn in my own personal examples and the examples here use npm. Could you try
to use
But also still post your Node version, |
@jthegedus yes, with Versions: |
I'll see if I can reproduce this problem tonight (12hrs from now). I have not come across it with my Yarn example which would indicate it's something to do with |
I just reverted your changes, updated the Node: 8.9.4 The deployed code does fail, but that is as expected #3886 (comment) until a new Next.js release with that fix. Just to be clear, this example should be run with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes as per the above comment should be made.
Thanks @jthegedus. I have added you as collaborator to my fork ( if you want make changes ). |
@sarovin Try running Unfortunately, I've not been able to reproduce your error. I have however tested the versions |
I have this error with
yarn deploy
:@jthegedus can you test this fix?