firebase-functions-interop
firebase-functions-interop copied to clipboard
Functions Not Detected/Deployed
trafficstars
Issue: Firebase cmdline utility does not detect any Firebase functions written in Dart.
Steps to Reproduce:
- File: functions/pubspec.yaml
dependencies:
firebase_admin_interop: ^1.2.2
firebase_functions_interop: ^1.0.0+1
dev_dependencies:
build_runner: ^1.2.3
build_node_compilers: ^0.2.1
environment:
sdk: '>=2.0.0 <3.0.0'
- File: functions/package.json
"name": "test",
"dependencies": {
"firebase-admin": "7.1.1",
"firebase-functions": "2.2.1",
"@google-cloud/firestore": "1.2.0"
},
"main": "build/node/index.dart.js",
"private": true
}
- File: functions/node/index.dart
import 'dart:async';
import 'package:firebase_functions_interop/firebase_functions_interop.dart';
void main() {
functions['helloWorld'] = functions.https.onRequest(helloWorld);
}
Future<void> helloWorld(ExpressHttpRequest request) async {
try {
request.response.writeln('Hello world');
} finally {
request.response.close();
}
}
- File: functions/build.yaml
$default:
sources:
- "node/**"
- "lib/**"
builders:
build_node_compilers|entrypoint:
generate_for:
- node/**
options:
compiler: dart2js
dart2js_args:
- --minify
- Command (working directory: functions/)
pub run build_runner build - Command (working directory: /)
firebase deploy --only functions - Expect: Function is deployed. Actual: No functions are detected or deployed.
Versions:
dart --version is 2.2.0
firebase --version is 6.5.0
npm --version is 6.4.1 (to match what Firebase uses)
Sorry for late reply. Is this still an issue?