Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

277
Views
Using es6 import statements in firebase functions

So i have been trying to use es6 in firebase functions so I can import like "import App from './src/App.js' . After adding type:"module" to my package.json I am getting the weirdest firebase functions error I have ever seen, and can not for the life of me figure out where it is coming from. Any help would be a amazing. enter image description here

//App.js
import React from "react"; 
const App =()=> {
    return <h1>Hello world!</h1>;
    }
export default App


//index.js
import functions from  "firebase-functions";
import App from "./src/App.js"
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase- 
functions

exports.helloWorld = functions.https.onRequest((request, 
response) => {
  functions.logger.info("Hello logs!", {structuredData: true});
  response.send("Hello from Firebase!");
});
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The firebase-functions is meant to be used on server-side (in the Cloud function) and not in a client web app. To setup Cloud functions, create a new directory and run firebase init. Follow the instructions and setup Cloud Functions.

The CLI will install all required modules and add a sample function like this:

import functions from  "firebase-functions";

exports.helloWorld = functions.https.onRequest((request, response) => {
  functions.logger.info("Hello logs!", {structuredData: true});
  response.send("Hello from Firebase!");
});

Then you can call your cloud function either by using Firebase SDK or using Fetch API.

Also checkout Getting started with Cloud Functions for Firebase for a detailed explanation.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!