Closed zirinisp closed 6 years ago
Sorry you're having issues. I'll look into this today and try to reproduce on my end. In the meantime could you provide output of following commands:
dart --version
node --version
firebase --version
As well as contents of package.json
and pubspec.yaml
.
Thank you for the prompt reply.
The versions are the following:
dart --version Dart VM version: 2.0.0-dev.53.0 (Thu May 3 12:35:47 2018 +0200) on "macos_x64" node --version v9.5.0 firebase --version 3.18.4
package.json
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "~5.12.0",
"firebase-functions": "^1.0.1"
},
"devDependencies": {
"eslint": "^4.12.0",
"eslint-plugin-promise": "^3.6.0"
},
"private": true,
"main": "build/node/index.dart.js"
}
pubspec.yaml
name: surf_spotter_functions
description: My project functions
version: 0.0.1
environment:
sdk: '>=2.0.0-dev <2.0.0'
dependencies:
# Firebase Functions bindings
firebase_functions_interop: ^1.0.0-dev
dev_dependencies:
# Needed to compile Dart to valid Node.js module.
build_runner: ^0.7.9
build_node_compilers: ^0.1.0
Thanks! Quick update: deploying Dart code you provided on my end worked fine.
I see that you have eslint
in your devDependencies, wondering if it messes up something since all the errors in the output are lint checks.
Do you have functions/.eslintrc.json
file? Wondering if it'd work after you delete that file?
(There is no benefit in linting generated JS code)
Just checking in here. Did you manage to resolve this issue? If so I'd be curious to know how you fixed it.
I installed the latest updates so my version are:
dart --version
Dart VM version: 2.0.0-dev.59.0 (Tue May 29 22:11:36 2018 +0200) on "macos_x64"
node --version
v9.5.0
firebase --version
3.18.5
I also removed .eslintrc.json
On firebase.json file I removed:
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
So the file looks like:
{
"functions": {
}
}
And my package.json file looks like:
{
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"lint": "eslint .",
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "~5.12.0",
"firebase-functions": "^1.0.1"
},
"devDependencies": {
},
"private": true,
"main": "build/node/index.dart.js"
}
Now it deploys without problems.
Thank you very much for your help!!
Awesome, thanks for getting back with the info! Closing this issue as resolved
Also had the same issue and it was gone after .eslintrc.json removal. Maybe consider adding it into readme?
I am new to Dart and although I love it, I struggle to find my way around it.
I followed the steps on this repo. I get a successful build:
Then when I try to deploy I get the following:
then hundreds of similar lines. That end with:
My index.dart file is the following:
Can you please help me out on how I can deploy.