-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[fix] Process symlinked routes #4957
[fix] Process symlinked routes #4957
Conversation
🦋 Changeset detectedLatest commit: 3980e3c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per @Conduitry's comment, this would error on symlinks to files, as readdirSync
throws when not called on a directory.
There seems to be a problem with Node's fs.readdirSync(dir, { withFileTypes: true })
returning false
for isDirectory()
on symlinks (open issue at nodejs/node#30646). It doesn't seem likely to get fixed upstream in a timely manner, so reverting to fs.statSync
instead of withFileTypes
seems like a better solution.
Thank you folks, I reverted to the |
Thank you for the follow-up! What should we do about the test? On Windows, the system's developer mode would have to be enabled as well as Git's We could add |
Co-authored-by: Maurício Kishi <mrkishi@users.noreply.github.com>
Interesting, I see the tests on Windows passed with the latest commit, but failed previously - although I don't think it was because of the new test I added 🤔. To make sure we have stable tests though, I agree that it's likely ok to skip on Windows. However, can you guide me into how I can exclude my sym-link test in a Windows environment? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, I pushed changes so tests are skipped when symlinks don't make it through git
.
lgtm.
thank you! |
Hey guys! Thanks again @mikenikles for your help ! Windows SymlinksPrerequisitesSymlink PermissionsYou have 1 of 3 options. If you try to create a symlink without one of these, you will see:
🟦 Option 1: Run as AdministratorWhen you make a symlink this way, you'll always need to open up the terminal as an 🟦 Option 2: Developer ModeThis is the easiest way but not the safest (security risk).
✅ Option 3: Local Security Policy
+ Security Settings > Local Policies > User Rights Assignment > Create symbolic links
Choose a Path:
|
Fixes #4936.
Process files within sym-linked directories.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm test
and lint the project withpnpm lint
andpnpm check
Changesets
pnpm changeset
and following the prompts. All changesets should bepatch
until SvelteKit 1.0