-
Notifications
You must be signed in to change notification settings - Fork 30.5k
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.1.0: Sun Oct 9 20:15:09 PDT 2022; root:xnu-8792.41.9~2/RELEASE_ARM64_T6000
Binaries:
Node: 18.12.1
npm: 8.19.2
Yarn: 1.22.19
pnpm: 7.24.2
Relevant packages:
next: 13.3.1-canary.16
eslint-config-next: 13.3.0
react: 18.2.0
react-dom: 18.2.0Which area(s) of Next.js are affected? (leave empty if unsure)
App directory (appDir: true), Routing (next/router, next/navigation, next/link), Static HTML Export (output: "export")
Link to the code that reproduces this issue
https://github.com/Royceb/nextjs-app-dir-tauri-router-push-example
To Reproduce
-
Ran
npx create-next-app@latest --experimental-app -
Set up Tauri
2.1: Ran
pnpm add -D @tauri-apps/cli2.2: Added
taurito package.json scripts. Ranpnpm tauri init. -
Updated next.config.js to use
output: "export"for SSG (Static Generation). -
Made a simple page at
app/examplePage/page.tsx -
Imported
next/navigationinapp/page.tsxand added a button that callsrouter.push('/examplePage'). -
Ran
pnpm tauri devand clicked the button. The app navigated to the example page as expected and rendered it properly. -
Ran
pnpm tauri buildand opened the app. Clicked the button. The app did naviate to the example page, but it did not render it properly. The page rendered code as text instead of rendering the page.
Describe the Bug
I was uncertain whether to open this in Tauri or NextJS, so I opened issues in both platforms.
While utilizing a NextJS application, version 13, and the experimental app directory, I encountered an issue where using router.push to navigate to a new page fails to render correctly. Although the navigation occurs successfully, the page only displays code as text instead of rendering the expected content. I have not found any console logs or errors related to this issue.
This problem only arises after building and running the application. Locally, everything seems to be functioning correctly.
Recording: https://user-images.githubusercontent.com/3469263/233444738-73f955e9-2aae-43fb-a92b-d0a4c1dd3c3e.mov
Expected Behavior
The page should render correctly.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
