-
Notifications
You must be signed in to change notification settings - Fork 201
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
lit-html render function breaks when minifying and compiling to es5 #724
Comments
@justinfagnani I've just run into this as well. Have you see it, or have any thoughts on where to go with this? My situation is as close to exactly the same as @orestisioakeimidis as possible. If having some sort of repo based reproduction would help find a resolution to this, let me know. |
Here is the repository to reproduce the error. https://github.com/orestisioakeimidis/polymer-lit-element-repro |
Appears to be a |
Good looking out @web-padawan ! It looks like the commits that maintain that are from @usergenic 676c28c and @justinfagnani 7b77998 I'm gonna do some research and see if at least the issues faced here are addressed by unfixing those dependencies. Not sure if there were tests created to support those decisions that will be able to back up the reality of removing them or not...one thing at a time though! |
On further review, it doesn't seem that updating those packages does the work we're looking for here. However, in accordance with babel/minify#574 (comment) the addition of Trying to get tests to report actionable things about this locally, but might end up submitting s PR just to get those results easier. Theoretically, |
Further comparisons between my instance of the issue and the above description point to this specifically being about instances where Continuing to look. |
Just in case if someone is interested: I have recently updated my Webpack starter to use Terser for minification: https://github.com/web-padawan/polymer3-webpack-starter @orestisioakeimidis @Westbrook feel free to try the config from there on your projects and see if that works for you. I would be glad to hear any feedback (as my project does not yet include lit-html). |
I have this issue as well. Any updates? |
Changing
to:
circumvents this particular issue. It's a bit scary, as this could happen to any part of the codebase. |
After more digging, it seems that this got magically fixed in lit-html 0.12.x. Before the render function was:
Now it's a variable:
This magically does not trigger the dead code removal, so it resolves the issue for now. But it can pop up in other places. In the minimal reproduction repository linked above, the version of lit-element is clamped so you keep seeing the error there. Bumping the version resolves it. |
Proposing #777 |
Also trying bumping babel-minify to more recent versions... |
More specifically I had updated the package.json with these two lines:
|
(the |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hi,
I am not sure if this is the right place to report this issue, but since it is a problem with the code compilation, it seems wise.
You can see below the two versions of the compiled code for the
render
function of thelit-html
package when using the Polymer LitElement.ES5 (not minified)
ES5 (minified)
As you can see the check of the
part
is missing which results to the following errorTypeError: Cannot read property 'setValue' of undefined at render
.These are the contents of the
polymer.json
file I am using.Any ideas?
The text was updated successfully, but these errors were encountered: