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

lodash/cloneDeep and lodash.clonedeep: Two output files share the same path but have different contents. #8428

Closed
7 tasks done
tajo opened this issue Jun 1, 2022 · 4 comments · Fixed by #8508
Closed
7 tasks done
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)

Comments

@tajo
Copy link
Contributor

tajo commented Jun 1, 2022

Describe the bug

When importing from lodash/cloneDeep and lodash.clonedeep in the same project, vite (or esbuild) throws:

✘ [ERROR] Two output files share the same path but have different contents: node_modules/.vite/processing/lodash_cloneDeep.js

This should not be an issue since those are two different packages and vite should create two different pre-bundled modules.

It might be because / and . gets normalized to _ and a colliding filename is created? There were some previous references of this issue in vite pointing to lower/upper case but this seems to be a different problem.

Reproduction

https://stackblitz.com/edit/vitejs-vite-fpc1de

System Info

stackblitz template

Used Package Manager

npm

Logs

No response

Validations

@patak-dev
Copy link
Member

Interesting, yes, I think we need to encode _ and . differently. PR welcome if you would to work on this, if not I'll check it 👍🏼
See

export const flattenId = (id: string): string =>

@patak-dev patak-dev added bug p3-minor-bug An edge case that only affects very specific usage (priority) and removed pending triage labels Jun 1, 2022
@btea
Copy link
Collaborator

btea commented Jun 3, 2022

Interesting, yes, I think we need to encode _ and . differently. PR welcome if you would to work on this, if not I'll check it 👍🏼 See

export const flattenId = (id: string): string =>

Why replace / and . with _ here?

@tajo
Copy link
Contributor Author

tajo commented Jun 3, 2022

Why replace / and . with _ here?

Afaik, it's used for the cached files so / needs to be replaced. But should be fine to just preserve .?

@btea
Copy link
Collaborator

btea commented Jun 3, 2022

@tajo Thanks for your reply, it looks like it does.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p3-minor-bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants