I am surely doing something wrong, but after days of trying I simply cannot import this npm package in my firebase function local installation. The npm package installs fine, I see it in my node_modules folder. But whatever I do with my firebase function index.js, I simply cannot make this line work (it's the only code in my function after isolating it):
Case 1: const { getStripePayments } = require("@stripe/firestore-stripe-payments");
OR
Case 2: import { createCheckoutSession } from "@stripe/firestore-stripe-payments";
I think these lines of the emulators debug log are referring to the problem:
Got response code 400; body Failed to generate manifest from function source: SyntaxError: Cannot use import statement outside a module
shutdown requested via /__/quitquitquit
!! functions: Failed to load function definition from source: FirebaseError: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error {"metadata":{"emulator":{"name":"functions"},"message":"Failed to load function definition from source: FirebaseError: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error"}}
Finally, I can run other functions in my firebase function index.js, but this package is the only one causing issues.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
install firebase and have it working locally
npm install @stripe/firestore-stripe-payments in your functions folder
try anything in a firebase function index.js with this package
Expected behavior
should be able to import the package, however I cannot seem to be able to import it, tried different ways to import
System information
windows 10
Thanks for your help, I have tried for a couple of days to simply import and use this package sdk and I am thinking of starting my firebase project from scratch because of this.
Bug report
Describe the bug
I am surely doing something wrong, but after days of trying I simply cannot import this npm package in my firebase function local installation. The npm package installs fine, I see it in my node_modules folder. But whatever I do with my firebase function index.js, I simply cannot make this line work (it's the only code in my function after isolating it):
Case 1: const { getStripePayments } = require("@stripe/firestore-stripe-payments"); OR Case 2: import { createCheckoutSession } from "@stripe/firestore-stripe-payments";
I think these lines of the emulators debug log are referring to the problem:
Got response code 400; body Failed to generate manifest from function source: SyntaxError: Cannot use import statement outside a module shutdown requested via /__/quitquitquit
!! functions: Failed to load function definition from source: FirebaseError: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error {"metadata":{"emulator":{"name":"functions"},"message":"Failed to load function definition from source: FirebaseError: Functions codebase could not be analyzed successfully. It may have a syntax or runtime error"}}
Finally, I can run other functions in my firebase function index.js, but this package is the only one causing issues.
To Reproduce
Steps to reproduce the behavior, please provide code snippets or a repository:
Expected behavior
should be able to import the package, however I cannot seem to be able to import it, tried different ways to import
System information
Thanks for your help, I have tried for a couple of days to simply import and use this package sdk and I am thinking of starting my firebase project from scratch because of this.