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

snackbar from template rendering issue #74

Open
caliny97 opened this issue Jun 17, 2019 · 5 comments
Open

snackbar from template rendering issue #74

caliny97 opened this issue Jun 17, 2019 · 5 comments

Comments

@caliny97
Copy link

Having a difficult time getting the snackbar from a template to work. Tried the code from the demo and a very simple template and it always rendered the same. Seems like the template content is not parsed.

image

@tionkje
Copy link

tionkje commented Jun 17, 2019

I have had a similar issue.
With me it was because i was using rollup and a different version of lit-html.
Internally it uses instanceof a lit-html class and rollup renamed them to prevent clashes.

Just make sure yout lit-element/lit-html versions are the same as in weightless.

@caliny97
Copy link
Author

I have had a similar issue.
With me it was because i was using rollup and a different version of lit-html.
Internally it uses instanceof a lit-html class and rollup renamed them to prevent clashes.

Just make sure yout lit-element/lit-html versions are the same as in weightless.

Made sure there is only one version of lit-element/lit-html being used but the issue still remains.
My project doesn't use roll-up or webpack, it uses boiler code from PWA.
Thanks

@caliny97
Copy link
Author

@andreasbm - any ideas about this issue? , I tried stepping thru but couldn't find the cause.
Thanks

@caliny97
Copy link
Author

After digging more into this, i found the issue. The if/else condition "value instanceof TemplateResult" is skipped, event thought value is clearly an instance of TemplateResult and it just defaults to commit the value as is. I guess the issue lies at lit-html , my code is running as ES modules from polymer cli, not babel or rollup. Any ideas how to resolve this? Thanks

image

@caliny97
Copy link
Author

Finally resolved this. It turns out that weightless npm install includes its own version of lit-html, the if condition was skipped because the instance of TemplateResult was from the weightless copy of lit-html.
For now i just deleted node_modules from node_modules/weightless.
@andreasbm any reason for including a copy of lit-html?
Thanks

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