1

When I attempt to firebase deploy I get the following error.

It seems to be about this line: import * as functions from 'firebase-functions'; at the begining of my file. I have not had any issues with this in the past. But I have recently been having issues with NPM and deploying.

Error: Error occurred while parsing your function triggers.

/Users/name/Desktop/Yoveo/functions/src/index.ts:1
import * as functions from 'firebase-functions';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at wrapSafe (internal/modules/cjs/loader.js:1052:16)
    at Module._compile (internal/modules/cjs/loader.js:1100:27)
    at Module._compile (pkg/prelude/bootstrap.js:1281:32)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1156:10)
    at Module.load (internal/modules/cjs/loader.js:984:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Module.require (internal/modules/cjs/loader.js:1024:19)
    at Module.require (pkg/prelude/bootstrap.js:1225:31)
    at require (internal/modules/cjs/helpers.js:72:18)
    at /Users/name/.cache/firebase/tools/lib/node_modules/firebase-tools/lib/triggerParser.js:15:15

Having trouble? Try firebase [command] --help
name@name-MacBook-Pro functions % 

How can I fix it?

I ran npm update and then ran firebase deploy again. got the same error. But with a recommendation to run npm install -g firebase-tools which after running deploy again, resulted in no change for the error.

4
  • Please edit the question to show what you did to get to this point. There should be enough information in the question so that anyone can reproduce the issue. Commented Nov 17, 2020 at 23:40
  • @DougStevenson I've had this issue for months. I don't think I will be able to recreate it. I will see what I can do. Commented Nov 17, 2020 at 23:41
  • I was unable to recreate. If anyone has suggestions that would be helpful. Commented Nov 18, 2020 at 1:55
  • We need at least a part of your code. Also check the similar questions stackoverflow.com/questions/59761839/…, stackoverflow.com/questions/60871924/… Commented Nov 18, 2020 at 16:31

1 Answer 1

1

Solved: I searched AsyncIterable in my folder. It returned a bunch of associated files connected to the different projects I have. I then highlighted and looked at the file path for all of them.

I found that the ones working correctly where associated with a project, and that the project that was not working would not show up. Except, however, for some files associated with no Xcode project.

Thus I concluded that there may have been a problem with the initial setup where many necessary files were associated with no particular project. Dont know how that happened. I will work to solve that now. Comment if you know how I could redo this or fix this issue.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.