-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Function Dependencies Causing Build To Fail #3025
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
Comments
Have the same problem, already tried to find a fix for it but have no solution right now. There are also many warning messages while trying to deploy. I think this causes the problem but I'm not sure. |
I deleted the node_modules folder and removed everything from the root package.json. I then created a new set of dependencies. I now get a new error while trying to deploy:
Here is the current package.json from the project root folder (main package.json):
The dist/sample/functions folder does have a generated package.json and package-lock.json, so not sure why the cloud builder is not able to access or detect that they exist. |
The project runs, when using |
@jasonbdt I found (A / THE) solution, but you may not like it. You'll have to do some downgrading so that all your dependencies can build properly. Here's what I did:
I believe those are the main three. I was able to keep angular (core, common, fire, material, etc..) at the latest versions. Be sure to change the |
@firstlinestudio Well, my environment runs on the following setup:
My Angular is at Version 12.2.0. When I want to update with Are you sure that NodeJS and NPM causes the error? |
@jasonbdt I'm sure that is what fixed my deploy issue, but it didn't not fix the project all together. I now have an issue with the SSR function not retrieving URLs. Every URL except root will return a "cannot get URL /sample/url" message when trying to access through the function. I can navigate the site just fine, but if I refresh a page -- other than the root homepage -- it will throw an error. That is in development. In production, the message shows |
The project is back to working fully. The moral of the story is to manage dependencies properly. I'm not sure if it is listed in the docs, but it would be useful to add "optimal" package versions somewhere (i.e. use nodejs 14, not nodejs 16) and/or have an optimal package.json available for the latest build. I recommend NOT doing a general |
@firstlinestudio of course, if you have installed firebase-tools globally you can remove the local package. I guess the developers doesn't suppose everyone to have firebase-tools installed globally, thats why they added it as local package which makes sense for me. As far as I know "devDependencies": {
"@angular-devkit/architect": "^0.1401.0",
"@angular-devkit/build-angular": "^14.1.0",
} The When I use {
"name": "functions",
"description": "Angular Universal Application",
"main": "index.js",
"scripts": {
"start": "firebase functions:shell"
},
"engines": {
"node": "14"
},
"dependencies": {
"firebase-admin": "^9.11.1",
"firebase-functions": "^3.6.0"
},
"devDependencies": {},
"private": true
} If all files created by the CLI for uploading to Cloud Functions, the command tries to install the dependencies named inside the Because of this, I have to mirror the dependencies section of my root package.json into I have also copied this repository and build a custom version of it with some code changes to make Sincerly |
Have you been able to solve it in your new repository, this issue is too old and it's sad there is still no solution for this. |
Yes, I was able to find a solution but sadly I had no time to test it properly to check if my solution would break anything else. |
@jasonbdt Would you be able to share your solution by any chance? |
Version info
Angular: 12.2.29
Firebase: 9.1.2 / 9.1.3
AngularFire: 7.1.0 / 7.1.1
Other (e.g. Ionic/Cordova, Node, browser, operating system): Windows Terminal / PowerShell
How to reproduce these conditions
Failing test unit, Stackblitz demonstrating the problem
Steps to set up and reproduce
In any terminal / powershell, run: ng deploy. The process will run until it attempts to upload the function. The function fails to deploy.
Sample data and security rules
package.json created in dist/{PROJECT_NAME}/functions
Debug output
** Errors in Windows Terminal **
** Error output from Google Cloud Builder Log **
"Step #1 - "build": Failure: (ID: XXXXXX) npm ERR! @angular-devkit/architect not accessible from {PROJECT_NAME}"
Expected behavior
To deploy successfully. Using 7.1.0-rc.4, the dist package.json does not try to access root dependencies and deploys successfully.
Actual behavior
Project will not deploy with cloud functions
The text was updated successfully, but these errors were encountered: