pulyaevskiy / firebase-functions-interop

Firebase Functions Interop Library for Dart.
BSD 3-Clause "New" or "Revised" License
191 stars 52 forks source link

Functions Not Detected/Deployed #49

Open SeanCheatham opened 5 years ago

SeanCheatham commented 5 years ago

Issue: Firebase cmdline utility does not detect any Firebase functions written in Dart.

Steps to Reproduce:

  1. 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'


2. 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
}
  1. 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 helloWorld(ExpressHttpRequest request) async { try { request.response.writeln('Hello world'); } finally { request.response.close(); } }


4. File: functions/build.yaml
```targets:
  $default:
    sources:
      - "node/**"
      - "lib/**"
    builders:
      build_node_compilers|entrypoint:
        generate_for:
        - node/**
        options:
          compiler: dart2js
          dart2js_args:
          - --minify
  1. Command (working directory: functions/) pub run build_runner build
  2. Command (working directory: /) firebase deploy --only functions
  3. 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)

pulyaevskiy commented 5 years ago

Sorry for late reply. Is this still an issue?