Dialogflow or Firebase slow Execution - firebase-realtime-database

My dialogflow project has encountered the following error message that I have been unable to resolve. Has anyone encountered such an issue and aware of how to resolve this?
dialogflowFirebaseFulfillment
Warning, estimating Firebase
Config based on GCLOUD_PROJECT.
Initializing firebase-admin may
fail
I am thinking that there may be an issue with my package.json file:
{
"name": "dialogflowFirebaseFulfillment",
"description": "This is the default fulfillment for a Dialogflow agents using Cloud Functions for Firebase",
"version": "0.0.1",
"private": true,
"license": "Apache Version 2.0",
"author": "Google Inc.",
"engines": {
"node": "8"
},
"scripts": {
"start": "firebase serve --only functions:dialogflowFirebaseFulfillment",
"deploy": "firebase deploy --only functions:dialogflowFirebaseFulfillment"
},
"dependencies": {
"actions-on-google": "^2.2.0",
"firebase-admin": "^8.9.0",
"firebase-functions": "^3.2.0",
"dialogflow": "^0.6.0",
"dialogflow-fulfillment": "^0.6.1"
}
}

The warning message is only that - a warning. It does not mean there is a problem.
If you are not using firebase-admin calls, then you have nothing to worry about.
If you are using firebase-admin, then you just need to be sure that the environment is referencing the project you expect.
Update
The "slow execution" is likely due to the Cloud Function cold starting - the environment had been shut down or otherwise wasn't running, so it needs to initialize and setup the environment. On subsequent calls, within a reasonable time, it should already be running and you won't experience the slowdown.

Related

I got "Error: packageJSON.main must be set to a valid entry point for your Electron app" when building with electron forge

I was building with electron forge and then it gave me this error in my terminal.
An unhandled rejection has occurred inside Forge:
Error: packageJSON.main must be set to a valid entry point for your Electron app
Electron Forge was terminated. Location:
{}
My package.json looks like this:
{
"name": "elephant",
"version": "1.0.0",
"description": "my new app",
"main": "main.js",
"scripts": {
"test": "elephant-test",
"start": "electron ."
},
"keywords": [
"editor",
"live-preview",
"html"
],
"author": "unknown",
"license": "MIT",
"devDependencies": {
"electron": "^16.0.7"
}
}
I am unable to resolve this issue. The app works fine when I put in: npm startWhat could I be doing wrong?
Ran into the same problem, for me it worked adding:
"main": "./dist/main.js",
to my package.json, because it's there I was building to.

Unable to open electron app after packaging the app using electron-builder

After building the electron application using electron-builder, I cannot open the application from the dist folder. I did change all my links to use path.join(__dirname, "relative_path/") as what I have seen in some answers here. But I can't open the application even though the packaging process is successful.
File structure for the electron app project
Here's an image of my file structure, and this is the package.json file of the project
{
"name": "my_little_reminder",
"version": "0.5.0",
"description": "A simple time reminder app",
"main": "src/index.js",
"scripts": {
"start": "electron .",
"test": "jest --coverage",
"build": "electron-builder --dir"
},
"author": "Leonlit",
"license": "MIT",
"dependencies": {
"node-notifier": ">=8.0.1",
"node-schedule": "^1.3.2",
"sqlite3": "^5.0.0",
"electron-log": "^4.3.1"
},
"devDependencies": {
"electron": "^11.2.1",
"electron-builder": "^22.9.1",
"jest": "^26.6.3"
}
}
Finally, here's a link to the repository if the information here is not enough, https://github.com/Leonlit/My-Little-Reminder/tree/development
Resolved the issue by adding and using the npm script "postinstall": "electron-builder install-app-deps".
Then, using path.join(app.getPath('userData'), '/tasks.db') instead of path.join(__dirname, '/tasks.db') for the sqlite database storage location.
Finally, changed a link in the index file which caused the application to always request for saving a ASAR file on app launch if left unfixed.

How to use electron-builder with target portable?

I am trying to generate a exe file with electron-builder not an installer so I am trying by setting the target to portable
{
"name": "hello-world",
"version": "1.0.0",
"description": "a hello world",
"main": "index.js",
"scripts": {
"start": "electron .",
"dist": "build"
},
"author": "KR",
"license": "ISC",
"devDependencies": {
"electron": "^4.1.4",
"electron-builder": "^20.39.0"
},
"build":{
"appId": "com.whatever.helloworld",
"win":{
"target": ["portable"],
"icon" : "build/icon.ico"
}
}
}
However when I try npm run dist I get
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
Configuring yargs through package.json is deprecated and will be removed in the next major release, please use the JS API instead.
• electron-builder version=20.39.0
• loaded configuration file=package.json ("build" field)
• writing effective config file=dist\builder-effective-config.yaml
• no native production dependencies
• packaging platform=win32 arch=x64 electron=4.1.4 appOutDir=dist\win-unpacked
• default Electron icon is used reason=application icon is not set
• building target=portable file=dist\hello-world 1.0.0.exe archs=x64
and the program is stuck for ever. When I break it(ctrl-c), it says
Error: Exit code: 255. Command failed: D:\electrontest\hello-world\node_modules\7zip-bin\win\x64\7za.exe a -bd -mx=9 -mtc=off -mtm=off -mta=off D:\electrontest\hello-world\dist\hello-world-1.0.0-x64.nsis.7z .
So I guess the program is stuck in 7za compression.
I searched and there is no example of using electron-builder with portable only few with nsis. (I have another question but first I would like to run the basics).
use electron-builder from 1
then in package.json use in scripts:
"dist": "electron-builder --win=portable",

Can not find module 'debug

I've been having this issue for a while and I've even opened an issue on electron-builder github page but haven't received any response.
I'm running electron builder version 20.38.4 and trying to package the app for Win 64 environment. Everything works fine when I do "yarn dev" and "yarn compile". Even "yarn dist" works without any issue.
However, when I click on the generated .exe file, I get this error message.
Any ideas?
Here's the link to the issue I've opened with some detailed screenshots and log outputs
https://github.com/electron-userland/electron-builder/issues/3561
Here's the package.json as requested
{
"name": "myproj",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"dev": "electron-webpack dev",
"compile": "electron-webpack",
"dist": "yarn compile && electron-builder",
"dist:dir": "yarn dist --dir -c.compression=store -c.mac.identity=null"
},
"dependencies": {
"#rodrigogs/mysql-events": "^0.5.2",
"electron-online": "^1.0.0",
"mysql": "^2.16.0",
"source-map-support": "^0.5.9"
},
"devDependencies": {
"electron": "3.0.10",
"electron-builder": "^20.38.4",
"electron-webpack": "^2.6.1",
"webpack": "^4.26.0"
},
"build": {
"appId": "com.teamio.app",
"productName": "Teamio",
"buildVersion": "1.0",
"copyright": "Copyright © 2018 Teamio.app",
"nsis": {
"oneClick": false,
"perMachine": true,
"allowElevation": true,
"allowToChangeInstallationDirectory": true,
"deleteAppDataOnUninstall": true,
"createDesktopShortcut": true,
"installerIcon": "build/icon.ico",
"uninstallerIcon": "build/icon.ico",
"uninstallDisplayName": "Uninstall Teamio"
},
"win": {
"target": "nsis",
"icon": "build/icon.ico"
}
}
}
Sorry to revive an old question, but what is happening is the electron-online package does not properly define its dependencies in its own package.json. So it is missing the debug package, which you have "solved" by placing another package that requires debug in your project dependencies. In reality though, the (long abandoned) package electron-online should update its dependencies and add debug, among others.
As a slightly cleaner workaround, you could add debug to your project dependencies instead of electron-webpack or webpack.
I had the same problem a few hours ago, resolved by not excluding (ignoring) the src folder from package config. Could you paste you package.json file here ?
Ok. Looks like I've solved my own problem. Not sure why exactly but it worked. What I had to do was move 2 dependencies listed below from devDependencies to dependencies section in my package.json
"electron-webpack": "^2.6.1",
"webpack": "^4.26.0"
If someone can shed some light on that, it'd be helpful. I figured I'd post it here in case someone else runs into this issue.

npm published yeoman generator not showing under yeoman.io

I have recently written a yeoman generator called 'generator-webvr-decorator'. Following the instructions from this post, I have done all the steps including publishing to npm. However, after four days I do still not see my generator listed under the yeoman generators web page. The number of generators seems to be frozen at 3438.
I have done all the following:
npm test passes.
I have 'yeoman-generator' in the package.json keywords:
```
{
"name": "generator-webvr-decorator",
"version": "0.1.5",
"description": "add WebVr boilerplate to an existing application",
"license": "MIT",
"main": "app/index.js",
"repository": "vt5491/generator-webvr-decorator",
"author": {
"name": "vt5491",
"email": "vt5491#gmail.com",
"url": "https://github.com/vt5491"
},
"scripts": {
"test": "mocha"
},
"files": [
"generators",
"lib"
],
"keywords": [
"yeoman-generator",
"webvr",
"vr",
"angular"
],
"dependencies": {
"async": "^1.5.0",
"chalk": "^1.0.0",
"cheerio": "^0.19.0",
"escope": "^3.3.0",
"esprima": "^2.7.0",
"jquery": "^2.1.4",
"jsonfile": "^2.2.3",
"lodash": "^3.10.1",
"merge": "^1.2.0",
"yeoman-generator": "^0.19.0",
"yosay": "^1.0.2"
},
"devDependencies": {
"mocha": "*"
}
}
```
published to npm. It is found by the npm search:
turner#vturner-virtual-machine ~/vtstuff/github2/generator-webvr-decorator $ npm search
generator-webvr-decorator
NAME DESCRIPTION AUTHOR DATE VERSION KEYWORDS
generator-webvr-decorator add WebVr boilerplate to an existing application =vt5491 2015-12-05 0.1.4 yeoman-generator webvr vr
Manually tested installing from the npm repository under windows and linux, so I know it physically works assuming yeoman does some kind of automated testing i.e checks to see if the generator actually runs.
Can anyone see what I'm doing wrong?
How often is the database of generators under yeoman.io updated?
Should I open a ticket with the yeoman web site?
I don't know what the add rate for generators is, but in the last four days the generator count has stayed constant at 3438.
Many Thanks.
The system fetching new generators is currently down: https://github.com/yeoman/yeoman-generator-list/issues/38 - It'll hopefully be up in the next few days.
We're also currently posting packages with yeoman-generator keywords that we exclude for other reason here: https://github.com/yeoman/yeoman-generator-list/issues/36 (I don't see yours in there, so your generator will show up soon)

Resources