-
Notifications
You must be signed in to change notification settings - Fork 48
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
Google Cloud functions framework not working when upgrading Nx from 17.0.3 -> 17.1.3 #182
Comments
Could you elaborate a bit more? What are the differences, what version of nx-extend (run PS: There is also a runner inside the nx-extend package that can run all your functions instead of only one at a time, |
@TriPSs Updated my original post. Will check the runner out thanks! is it part of the same package or a different one? |
It is, you can generate the runner project with Regarding your issue: could it be that something within your |
Createing a completely brand new project - same error. Will give your runner a try, thank you! |
Could you also give it a try |
Also wondering if it works if you do the following: const functions = require('@google-cloud/functions-framework');
functions.http('helloWorld', (req, res) => {
res.send('Hello, World');
}); |
This one works. The new angular however forces us to use to use >=5.2 |
this does not |
Interesting, not sure if we can do something about it here. |
Hey @TriPSs, I think until google updates their typescript package to the latest typescript, you're right there isn't much we can do. I tried running your runner, I'm encountering this error:
Here's my main.ts:
Here's the generated project.json:
Is there something I've missed? Thanks! |
Sorry for that, just now noticed that when updating the code to the latest runner I did not update the generating of the runner, can you change your json to the following: {
"name": "cloud-functions-runner",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"projectType": "application",
"sourceRoot": "apps/cloud-functions-runner/src",
"targets": {
"_build": {
"executor": "@nx/webpack:webpack",
"outputs": ["{options.outputPath}"],
"options": {
"outputPath": "dist/apps/cloud-functions-runner",
"main": "apps/cloud-functions-runner/src/main.ts",
"tsConfig": "apps/cloud-functions-runner/tsconfig.app.json",
"compiler": "tsc",
"target": "node",
"namedChunks": true
}
},
"serve": {
"executor": "@nx/js:node",
"options": {
"buildTarget": "cloud-functions-runner:_build"
}
}
},
"tags": []
} Let me know if it works or if you get other issues. |
Amazing, and how does it register the routes and call the functions? Do we need to set up explicitely the endpoints names? |
Based on the info inside the projects deploy info it will build an endpoint, the runner should also log all the endpoints it registeres. So each function needs to be added to the map, with map<nx project name, import to main file>. They can than be called like localhost:9000/ |
|
Could you share the project.json of that cloud function? |
It's the same one you provided above:
|
This is the of the runner, I mean the one of the actual function, since the runner uses the project.json of the imported projects inside the map and than uses the target where the executor is For example, it uses the required |
There's no I've defined the entryPoint and now everything works well. Thank you! |
Sorry for all the issues here, I really need to invest some time and finish + update docs (#152). The issues we encountered here I updated. |
No worries mate, you're doing great work - your library saved me a ton of time. I'll also find some time to contribute in the upcoming weeks, this is a great project and a great time saver. Thank you |
When attempting to deploy, I'm getting the following:
Logs state that the healthcheck is failing. This wasn't a problem before, did you face this at any point? |
just to make sure, you are deploying the function right? Not the runner? Double checking: entry point is correct? |
Yes the function, and entry point is correct |
There is no other error in the logs that could point out why it failed to start? |
FYI: I have created an slack for an other opensource project I maintain, if you want you can also join there and maybe share a bit more info on your code. |
Here are the errors. And sure, will join! |
Downgrading to Reference: nrwl/nx#20349 |
Nx released the fix (17.2.0) |
Good to know: also update to the latest nx-extend version, Nx introduced a couple more issues which are now temporarily solved by the package. |
Yea realized that, thanks! |
Running a cloud function used to work with v17.0.x
From what I realized: the build in the
dist
is different between the two versions:Nx Report (17.0.3):
Compiled version before update (17.0.3):
Nx Report (17.1.3):
Compiled version after update (17.1.3):
The text was updated successfully, but these errors were encountered: