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

During dev mode, each time node_modules package imports file internally, makes that module have unique identity. #77

Open
minht11 opened this issue Dec 10, 2022 · 3 comments

Comments

@minht11
Copy link

minht11 commented Dec 10, 2022

During dev mode, each time node_modules package imports file internally, makes that module have unique identity.

// inside node_modules/some-package

// a.js
export const uniqueVariable = {}

// b.jsx
import { uniqueVariable }  from './a'
export compare = (variable) => uniqueVariable === variable

// index.jsx
import { uniqueVariable }  from './a'
import { compare }  from './b'
compare(uniqueVariable) // Produces false

After updating to latest Solid version, from Solid 1.4.4 I noticed that useContext broke with my library, and that lead me to discovering this issue. The issue only occurs during dev mode and only inside with node_modules.

Reproduction

I manually edited node_module of my package to check.
Screenshot 2022-12-10 at 19 48 28

@ryansolid
Copy link
Member

ryansolid commented Mar 21, 2023

What version of the plugin are you using? And do you still have this problem? We did a lot of work to get deduping to work but I imagine there are still gaps.

@minht11
Copy link
Author

minht11 commented Mar 21, 2023

Tried updated everything to the latest, so plugin version would be 2.6.1, I am still experiencing this issue.

@minht11
Copy link
Author

minht11 commented Mar 21, 2023

I think this might be related to #80 since my context is also defined in tsx file, but I haven't tested to see if that is the root issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants