firebase hosting URL parameters not getting read after deploying

Viewed 80

I am trying to deploy an app to firebase hosting,

this is my structure for the problematic URL:

http://.../Registration?id=something

in development, it works perfectly but after deploy it won't work, this is the line that it's having trouble with:

  if(!router.query.id)
  {
      console.log(router.query);
      return (
          <h1>No ID Given</h1>
          )
  }

I've checked multiple times, same URL, same paramter, this is my firebase hosting json file:

{
  "firestore": {
    "rules": "firestore.rules",
    "indexes": "firestore.indexes.json"
  },
  "hosting": {
    "public": "out",
    "ignore": ["firebase.json", "**/.*", "**/node_modules/**"],
    "cleanUrls": true
  }
}

with or without cleanUrls it doesn't work.

Does anyone know what I need to change in order for it to work?

I deploy using the following command: npm run build; npm run export; firebase deploy where the commands are the following:

  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "next lint",
    "export": "next export"
  },
0 Answers
Related