Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions Not Detected/Deployed #49

Open
SeanCheatham opened this issue Mar 26, 2019 · 1 comment
Open

Functions Not Detected/Deployed #49

SeanCheatham opened this issue Mar 26, 2019 · 1 comment

Comments

@SeanCheatham
Copy link

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'
  1. 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<void> helloWorld(ExpressHttpRequest request) async {
  try {
    request.response.writeln('Hello world');
  } finally {
    request.response.close();
  }
}
  1. File: functions/build.yaml
  $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
Copy link
Owner

Sorry for late reply. Is this still an issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants