pulyaevskiy / firebase-functions-interop

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

Library 'package:node_interop/http.dart' doesn't export a 'HttpRequest' declaration. #7

Closed ziizii closed 6 years ago

ziizii commented 6 years ago

Warning during Dart2JS compilation

bin/packages/firebase_functions_interop/firebase_functions_interop.dart:42:46:
Library 'package:node_interop/http.dart' doesn't export a 'HttpRequest' declaration.
Try removing 'HttpRequest' from the 'show' clause.
export 'package:node_interop/http.dart' show HttpRequest;
                                             ^^^^^^^^^^^

which may lead to error in the execution of the deployed function:

RuntimeError: Cannot resolve 'HttpRequest'.
    at d (/user_code/index.js:1223:3)
    at is (/user_code/index.js:1230:24)
    at ec.dart.ec.$2 (/user_code/index.js:3860:21)
    at cF (/user_code/index.js:1197:112)
    at dart.hy (/user_code/index.js:3716:27)
    at /user_code/index.js:3712:42
    at cloudFunction (/user_code/node_modules/firebase-functions/lib/providers/https.js:26:47)
    at /var/tmp/worker/worker.js:671:7
    at /var/tmp/worker/worker.js:655:9
    at _combinedTickCallback (internal/process/next_tick.js:73:7)

my pubspec.yaml:

dependencies:
  firebase_functions_interop: "^0.1.0-beta.2"
  node_interop: ^0.1.0-beta.6

my index.dart:

import 'dart:io';

import 'package:firebase_functions_interop/firebase_functions_interop.dart';

void main() {
  firebaseFunctions['test'] = firebaseFunctions.https.onRequest(test);
}

test(HttpRequest request) {
  request.response.writeln('Hello world');
  request.response.close();
}
pulyaevskiy commented 6 years ago

I've just published 0.1.0-beta.3 which should address this: https://pub.dartlang.org/packages/firebase_functions_interop/versions/0.1.0-beta.3

Note: I will be releasing first 1.0.0-dev version today. 0.1.x and 0.0.x branches will not be actively maintained after that. All new features and improvements will go to 1.0.0.