I am creating a directory outside of the project, let's call it vendors
and creating a symlink from app/vendor
to one of these vendors in this external directory. However, when navigating to a page.tsx inside one of these directories it just results in 404 being shown in the browser.
I've tried to trace the code and it seems to be resolving the symlinks correctly in the next\dist\lib\recursive-readdir.js
file inside the recursiveReadDir
function. When testing whether a link is a directory or a pathname it correctly (seemingly) ends up in the directories array.
I've created a minimal reproduction of the issue and linked the repo to this discussion.
Steps to reproduce:
- Clone the repo attached
npm i
- Navigate to
src\apps
in the command line - Create a symlink in Windows by running
mklink /D vendor ..\..\vendors\test-vendor-1
or in Unix withln -s ../../vendors/test-vendor-1 vendor
npm run dev
- Navigate to http://localhost:3000/vendor/posts
Observe the following:
If you remove the symlink and paste the vendor files directly into the app/vendor
folder you observe: