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

@open-wc/scoped-elements v2.2.4 breaks lit module resolution #2728

Open
electrovir opened this issue Nov 2, 2023 · 3 comments
Open

@open-wc/scoped-elements v2.2.4 breaks lit module resolution #2728

electrovir opened this issue Nov 2, 2023 · 3 comments

Comments

@electrovir
Copy link

electrovir commented Nov 2, 2023

Expected behavior

No problems with lit module resolution. (As the behavior in @open-wc/scoped-elements v2.2.3)

Actual Behavior

If @open-wc/scoped-elements v2.2.4 is installed, two different versions of @lit/reactive-element get installed (v1.6.3 and v2.0.1) which confuses lit and leads to the warning:

Multiple versions of Lit loaded. Loading multiple versions is not recommended.

Workaround

Either add "@lit/reactive-element": "^1.6.3" or "@open-wc/scoped-elements": "2.2.3" to the "overrides" field of your package.json file.

Additional context

electrovir added a commit to Toniq-Labs/toniq-labs-design-system that referenced this issue Nov 2, 2023
@justinfagnani
Copy link

I feel like there's an npm bug where it's not choosing a common version of a library only when there's an upgrade of one package. npm dedupe hasn't helped. I've also been able to fix this by removing my package lock and node_modules folder and re-installing, which might not be possible for all projects.

@electrovir
Copy link
Author

I've also been able to fix this by removing my package lock and node_modules folder and re-installing, which might not be possible for all projects.

Interestingly, doing this is actually what originally put me in this broken situation 😅. Maybe npm version matters? I'm on npm v9.8.0, haven't tried v10 yet.

@electrovir
Copy link
Author

electrovir commented Nov 2, 2023

Looks like I also need a "@open-wc/testing-helpers": "2.3.0" override

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