Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic routes don't work correctly with basePath #42912

Open
1 task done
PolinaJSN opened this issue Nov 14, 2022 · 1 comment
Open
1 task done

Dynamic routes don't work correctly with basePath #42912

PolinaJSN opened this issue Nov 14, 2022 · 1 comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.

Comments

@PolinaJSN
Copy link

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
Platform: win32
Arch: x64
Version: Windows 10 Pro
Binaries:
Node: 16.16.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant packages:
next: 12.3.3
eslint-config-next: 11.1.4
react: 17.0.2
react-dom: 17.0.2

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

Describe the Bug

When any basePath added in next.config, rewrites for dynamic paths don't work
As fallback: true is used, the first time page loads without props and then the props are passed

Expected Behavior

Without basepath rewrites for dynamic paths work and pages load with proper content from the first time

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

https://stackblitz.com/edit/vercel-next-js-hxjczp?file=pages%2Fnews%2F[slug].tsx,next.config.js,pages%2Findex.tsx

To Reproduce

  1. Pate https://vercel-next-js-hxjczp-xlov6swr--3000.local-credentialless.webcontainer.io/nl/nieuws/some-url in the search input - you will see THIS SHOULD NOT APPEAR and than This should appear. If it was too fast you can check the preview of this page in networks (see screenshot)
    image

    1. Comment basePath in next.config
    2. Restart project
    3. Paste https://vercel-next-js-hxjczp-xlov6swr--3000.local-credentialless.webcontainer.io/nieuws/some-url.
      You will see only This should appear on the page. Preview in networks:
      image
@PolinaJSN PolinaJSN added the bug Issue was opened via the bug report template. label Nov 14, 2022
@vercel-release-bot
Copy link
Collaborator

This issue has been automatically marked as stale due to two years of inactivity. It will be closed in 7 days unless there’s further input. If you believe this issue is still relevant, please leave a comment or provide updated details. Thank you.

@vercel-release-bot vercel-release-bot added the stale The issue has not seen recent activity. label Jan 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template. stale The issue has not seen recent activity.
Projects
None yet
Development

No branches or pull requests

2 participants