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 in Symlinks is not working #16660

Open
Alicetech opened this issue Aug 28, 2020 · 6 comments
Open

Dynamic Routes in Symlinks is not working #16660

Alicetech opened this issue Aug 28, 2020 · 6 comments
Labels
good first issue Easy to fix issues, good for newcomers Navigation Related to Next.js linking (e.g., <Link>) and navigation.
Milestone

Comments

@Alicetech
Copy link

Alicetech commented Aug 28, 2020

Bug report

Describe the bug

Dynamic Routes in symlinks is not working

To Reproduce

I don't think github repos support symlink commits so this is how you can reproduce this:

In project folder:

mkdir pages/nolink
echo "export default function Post() {return <div>Works</div>}" > "pages/nolink/[id].js"
echo "export default function index() {return <div>Works</div>}" > "pages/nolink/index.js"
ln -s nolink pages/symlinktest

Expected behavior

System information

  • OS: Linux
  • Version of Next.js: ^9.5.2
  • Version of Node.js: v12.18.2

Additional context

I also tried this in next.config.js:

module.exports = {
    webpack: (config, { buildId, dev }) => {
      config.resolve.symlinks = false
      return config
    },
  }

index.js is for debug the error. Removing index.js did not help. This points to Dynamic Routes not supporting symlinks.

@bitfrost
Copy link

This open PR may also fix this issue #16369

@Timer Timer added good first issue Easy to fix issues, good for newcomers kind: bug labels Aug 30, 2020
@Timer Timer added this to the 9.x.x milestone Aug 30, 2020
@Timer Timer modified the milestones: 9.x.x, backlog Sep 7, 2020
@timneutkens timneutkens added the Navigation Related to Next.js linking (e.g., <Link>) and navigation. label Nov 18, 2021
@marcus-jan
Copy link

This is still an issue in v12.2.5. Very annoying limitation for a file based routing system.

@glassdimlygr
Copy link

glassdimlygr commented Sep 7, 2022

Hard to believe that symlinks don't work... symlinks are a deep part of the filesystem. I guess if I went with Vercel this would be fixed.

@artola
Copy link

artola commented Oct 1, 2022

@timneutkens I have symlinked pages and dynamic worked until 12.2.4 but it is broken since 12.2.5.

Nothing is reported as breaking change in such minor version, could you please give me some hint?

I tracked the changes as following:

  • It works up to 12.2.5.canary-3
  • It fails since 12.2.5.canary-4

@viktor-hepur
Copy link

viktor-hepur commented Oct 31, 2023

31 Oct 2023 Next 13.5.6 the same problem =( Static route works, dynamic - 404

@ScriptShah

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Easy to fix issues, good for newcomers Navigation Related to Next.js linking (e.g., <Link>) and navigation.
Projects
None yet
Development

No branches or pull requests