Deploying Firebase and Node.js application results in error: Error: Parse Error in remoteconfig.template.json: Unexpected token 'i' at 1:1

Viewed 1552

I tried many things mentioned in this portal none worked hence posting the same.

I have created a web application using the Node.js and I am trying to host that application using the Firebase so it can be accessed by my Colleagues and try out the features. I followed the instruction provided by Firebase and ran the following commands:

  1. Created a project in Firebase console

  2. npm install -g firebase-tools

  3. firebase login

  4. firebase init (Selected HOSTING with spacebar and * sign appeared next to it)

  5. I have a public folder with the index.html file within it.

  6. firebase deploy

When I run the firebase deploy I get the following error: enter image description here

I looked at some answers based on that everything seems to be fine for me:

My firebase.json file has following content:

    {
  "hosting": {
    "public": "public",
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  },
  "remoteconfig": {
    "template": "remoteconfig.template.json"
  }
}

Not sure what exactly is going wrong. Can someone please help me how to host the Node.js application in Firebase.

2 Answers

I think the solution is to add {} to the offending remoteconfig file and thus make it valid JSON. It is currently completely empty.

After some trying I was able to resolve the issue, posting the same so it can be helpful to someone in the future:

  1. I deleted .firebaserc and firebase.json file which are created during the previous firebase init from the project folder.

  2. I started with the firebase init again and that worked.

Related