When I try to run sudo functions deploy login --trigger-http, I get the following error:
ERROR: Function load error: Code could not be loaded.
ERROR: Does the file exists? Is there a syntax error in your code?
ERROR: Detailed stack trace: module.js:549
But I already have an index.js file in /lib. I don't know if there's a bigger issue than this because I just solved my last issue. Or this could be unrelated. I've been having a hard time gettings functions running locally with debugging:
I found the answer. I had to change directories into the functions folder.
Additional answer to make more clear.
In my case, i'm trying to run my function inside google functions-emulator then this error happen.
But with short solution from #AskYous, i still got a little confuse.
So like #AskYous answer, we have to enter into functions folder, then type like this:
C:\FirebaseFunctionTypescript\functions>functions deploy api --trigger-http
The "api" is our exported functions inside index.ts file.
Related
I have a .NET Core 3.1 cloud function (zipped source code on Cloud Storage Bucket), last time I successfully deployed it a month ago. Now I did a minor code change, zipped the source code and wanted to deploy a new version of it I get the following error:
Deployment failure: Build failed: Failed to run /bin/build: runtimeconfig.json does not exist; Error ID: 6b309792
It's really weird, I also tried to deploy the same source code that worked before and got the same error... What's the reason and how to fix it?
EDIT:
I forgot to mention that this function consists of a few projects in the following structure:
src
-my-function
-referenced_solution
--project1
--project2
--project3
To let GCP understand the structure I used GOOGLE_BUILDABLE="./my-function"
After some experimentation I changed var GOOGLE_BUILDABLE to just "my-function" and that fixed the problem. Still strange that it used to work fine with "./my-function"
After making some changes in a JSON manifest file, I was trying to update it following the Amazon documentation:
ask smapi update-skill-manifest -g development -s amzn1.ask.skill.xxxx --manifest "skillManifest.json" --debug
I kept getting this error:
The error was not pointing to what the error was but my guess was that it was related to the parameters, but that was strange as I was following the documentation to letter.
I then tried, instead of passing the json file, to cat the content of the file, which would be either:
For Powershell: --manifest "$(type skillmanifest.json)"
For Linux: --manifest "$(cat skillmanifest.json)"
I still kept getting the same error.
Firstly, for debugging and getting a more accurate error, I checked my ASK-CLi version, which was outdated.
After updating ASK to the latest version I was still getting the same error.
At that point it started including an error object, which was saying:
When looking into Parsing error due to invalid body. and INVALID_REQUEST_PARAMETER through the error codes, it just said the body of the request cannot be parsed.
After research and playing around, the problem was the manifest parameter, changing it to "file:FILENAME" solved the issue:
--manifest "file:skillmanifest.json"
The documentation is not stating this but it seems necessary for it to go through.
I hope this helps someone out there avoid spending a full day troubleshooting.
I have a firebase functions project. It’s giving me the following error:
TypeError: Cannot read property 'privatekey' of undefined
The error is coming from this line here:
functions.config().blockchain.privatekey
Functions.config() is returning {} <— An empty object.
So my question is: why is it returning {}, and how can I fix it?
I’ve been able to solve similar problems with functions.config() in the past with this:
firebase functions:config:get > .runtimeconfig.json
But this isn’t working this time.
Is it something to do with how firebase init is configured? A node package?
Any help would be very much appreciated.
I had the same issue with the same folder structure and fixed it by changing directory (in PowerShell) into the "functions" folder and then running firebase serve from there.
If anyone gets this error after creating the .runtimeconfig.json
Try checking the encoding of your file. For me it was failing because the file was encoded as UTF-16 LE. I changed it to UTF-8 and it works fine
I am running the command: devtools::use_testthat()
and I get the error:
Error: Could not find package root.
Why this happens?
devtools appears now to require the user to setwd("~/path/to/package"), even if functions like devtools::release() have the pkg= parameter set correctly.
My problem was very similar, but running devtools::document(setwd(...)). The only thing that worked for me:
I copied the DESCRIPTION file from another package (https://github.com/filipezabala/voice);
I ran devtools::document(setwd(...)) again;
After that, I edited the DESCRIPTION file and ran again devtools::document(setwd(...)).
I have been using roxygen2::roxygenise quite successfully with my package to build exported and imported functions. However, I recently ran into this error which I am unable to resolve:
> roxygen2::roxygenise()
First time using roxygen2. Upgrading automatically...
Error: File file does not exist
This is not the first time I have used roxygen2 with this package. In addition, I am not quite sure what "File file does not exist" means. Has anyone else seen this and been able to resolve it?
I think you have to set the working directory of R to be the package folder
I got the same error when using:
roxygen2::roxygenise("mypackage")
But, I didn't get the error when I instead used:
library(roxygen2)
roxygenise()
I know this is no explanation and I can't comment upon whether this works beyond my case.