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

Symlink resolved in entry module id regression #5415

Closed
7 tasks done
khalwat opened this issue Oct 25, 2021 · 4 comments
Closed
7 tasks done

Symlink resolved in entry module id regression #5415

khalwat opened this issue Oct 25, 2021 · 4 comments
Labels
pending triage regression The issue only appears after a new release

Comments

@khalwat
Copy link
Contributor

khalwat commented Oct 25, 2021

Describe the bug

I have build setup that used to work in Vite pre 2.6, but now appears to be broken. In the Vite root dir, I have an symlink src/ that aliases to a directory outside of the Vite root. This is done for organizational purposes, when I build with manifest: true to output a manifest.json, the keys in the manifest used to look like this:

  "src/main.js": {

but now it resolves the symlink as part of the path:

  "../src/main.js": {

...which is not the desired result. Changing resolve.preserveSymlinks doesn't seem to have any effect.

It appears to resolve the symlink, and use that as the facadeModuleId , which appears to be a regression.

Reproduction

Steps to reproduce:

  1. clone the repo: https://github.com/khalwat/vite-symlink-issue
  2. cd buildchain then npm run build
  3. Examine the output in buildchain/dist/manifest.json

Expected result:

  • The manifest entry would match the import in index.html: "src/main.js"

Actual result:

  • The manifest entry has the resolved symlink in the key: "../src/main.js"

System Info

n/a

Used Package Manager

npm

Logs

No response

Validations

@michaelrog
Copy link

michaelrog commented Oct 26, 2021

This broke my build as well.

Just to confirm I'm not misunderstanding... This is what resolve.preserveSymlinks is intended to address, right?

@sodatea sodatea added the regression The issue only appears after a new release label Oct 27, 2021
@khalwat
Copy link
Contributor Author

khalwat commented Oct 29, 2021

Yeah I'm wondering if that preserveSymlinks PR could be the root cause #4708

@khalwat
Copy link
Contributor Author

khalwat commented Dec 6, 2021

I can confirm that this is fixed in ^2.7.0-beta.10 -- I'm not sure which version of 2.7.0 specifically it was fixed, however.

@bluwy
Copy link
Member

bluwy commented Dec 6, 2021

Thanks for the confirmation! Closing this as it's fixed in the beta version. 2.7.0 stable will be released soon.

@bluwy bluwy closed this as completed Dec 6, 2021
@github-actions github-actions bot locked and limited conversation to collaborators Dec 21, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
pending triage regression The issue only appears after a new release
Projects
None yet
Development

No branches or pull requests

4 participants