3

I am using NextJs 13 with experimental feature of "appDir"
while deploying to firebase hosting, dynamic routes become static path.
for example :
path app/[slug]/page.jsx become http://example.web.app/[slug]

you can slug is consider as static page

You can see [slug] is consider as static page

Steps to reproduce

  1. create nextjs13 app npx create-next-app@latest --experimental-app
  2. create app/[slug]/page.jsx.
  3. enable firebase experiments:enable webframeworks
  4. make sure to enable billing.
  5. firebase init hosting then firebase deploy
  6. after successfully deployment, check http://your-domain.web.app/hello, you will see page not found but http://example.web.app/[slug] is working.

in firebase.json

{
  "hosting": {
    "source": ".",
    "cleanUrls": false,
    "ignore": [
      "firebase.json",
      "**/.*",
      "**/node_modules/**"
    ]
  }
}

in next.config.js

/** @type {import('next').NextConfig} */
const nextConfig = {
  experimental: {
    appDir: true,
  },
}

module.exports = nextConfig

in jsconfig.json

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["./*"]
    }
  }
}
Rajendra A Verma
  • 268
  • 2
  • 11

0 Answers0