vercel/next.js

Dynamic Routes in Symlinks is not working

Open

#16,660 opened on Aug 28, 2020

View on GitHub
 (10 comments) (3 reactions) (0 assignees)JavaScript (31,066 forks)batch import
Linking and Navigatinggood first issue

Repository metrics

Stars
 (139,471 stars)
PR merge metrics
 (Avg merge 3d 23h) (361 merged PRs in 30d)

Description

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.

Contributor guide