vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.09k stars 27k forks source link

Dynamic Routes in Symlinks is not working #16660

Open Alicetech opened 4 years ago

Alicetech commented 4 years ago

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

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 commented 4 years ago

This open PR may also fix this issue https://github.com/vercel/next.js/pull/16369

marcus-jan commented 2 years ago

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

glassdimlygr commented 2 years ago

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 commented 2 years ago

@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:

viktor-hepur commented 1 year ago

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

ScriptShah commented 2 months ago

I like to work on this issue please assign me.

Edit by maintainer bot: Comment was automatically minimized because it was considered unhelpful. (If you think this was by mistake, let us know). Please only comment if it adds context to the issue. If you want to express that you have the same problem, use the upvote 👍 on the issue description or subscribe to the issue for updates. Thanks!