-
Notifications
You must be signed in to change notification settings - Fork 829
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
render issues working with lit 2 #2433
Comments
I'm having the same issue. In fact not just the mwc-button, but many others (mwc-dialog raising 'TypeError: Cannot read property 'classList' of null' etc) I am however able to get around the problem building my own local version of node_modules/@material instead of getting it from npm. Could it be a packaging / distribution issue rather than a specific component? sorry I'm not very familiar with the tooling and terminology. Steps to reproduce and 'fix' the problem:
this brings the various node_modules/@material dependencies.
everything works as expected now. |
Do we have any fix for this yet? |
The update on my side was that removing the entire content of my node_modules and doing |
I just deleted my node_modules, and install again tried to import it via The error seems to have gone but the mwc template is not showing |
this is for buttons, I do |
yours should probably be |
Yes used mwc-textfield but same error again. I just cloned https://github.com/material-components/material-components-web-components.git I want to build and grab the files I want is that what you did? |
At that point I'm unable to help further because it works for me. Here's what my package.json looks like
|
Alright thank you for your time |
Russell on the team was able to diagnose the direct issue. when you install from npm the folder structure comes out to something like this
this means that mwc-ripple and mwc-button are using the same version of lit-html but it's not the same file. this means that the lit-html 1 tactic of doing The fix here is to make node_modules deduplicate the lit 1 dependencies or wait for us to push a lit 2 version of MWC |
Thank you @e111077 |
Is it fixed now? |
Hello, Lit 2 stable was released in october and MWC was updated to Lit 2 the same day as release. If you're still running into this issue, please update your mwc installation to one that uses Lit 2 |
This is just an example but will also effect any other components which is using the ripple component.
To Reproduce
Steps to reproduce the behavior:
npm i
npm i @material/mwc-button
<mwc-button raised label="test"></mwc-button>
to the render fn in the my-elements.ts fileimport "@material/mwc-button";
to the my-elements.ts fileresult:
none console errors....
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
If applicable, add screenshots to help explain your problem.
Browser Version (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: