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

Cannot parse some components using minify-html-literals #5490

Closed
kenzoi opened this issue Feb 23, 2024 · 1 comment
Closed

Cannot parse some components using minify-html-literals #5490

kenzoi opened this issue Feb 23, 2024 · 1 comment

Comments

@kenzoi
Copy link

kenzoi commented Feb 23, 2024

What is affected?

Tooling

Description

When we try to build a bundle, <md-icon-button> and <md-outlined-text-field> components are causing the following parse errors by minify-html-literals.

(!) Plugin minify-html-literals: Parse Error: <@TEMPLATE_EXPRESSION();
        class="icon-button @TEMPLATE_EXPRESSION();"
        id="button"
        aria-label="@TEMPLATE_EXPRESSION();"
        aria-haspopup="@TEMPLATE_EXPRESSION();"
        aria-expanded="@TEMPLATE_EXPRESSION();"
        aria-pressed="@TEMPLATE_EXPRESSION();"
        ?disabled="@TEMPLATE_EXPRESSION();"
        @click="@TEMPLATE_EXPRESSION();">
        @TEMPLATE_EXPRESSION();
        @TEMPLATE_EXPRESSION();
        @TEMPLATE_EXPRESSION();
        @TEMPLATE_EXPRESSION();
        @TEMPLATE_EXPRESSION();
        @TEMPLATE_EXPRESSION();
  </@TEMPLATE_EXPRESSION();>
node_modules/@material/web/iconbutton/internal/icon-button.js
(!) Plugin minify-html-literals: Parse Error: <@TEMPLATE_EXPRESSION();
      class="field"
      count=@TEMPLATE_EXPRESSION();
      ?disabled=@TEMPLATE_EXPRESSION();
      ?error=@TEMPLATE_EXPRESSION();
      error-text=@TEMPLATE_EXPRESSION();
      ?focused=@TEMPLATE_EXPRESSION();
      ?has-end=@TEMPLATE_EXPRESSION();
      ?has-start=@TEMPLATE_EXPRESSION();
      label=@TEMPLATE_EXPRESSION();
      max=@TEMPLATE_EXPRESSION();
      ?populated=@TEMPLATE_EXPRESSION();
      ?required=@TEMPLATE_EXPRESSION();
      ?resizable=@TEMPLATE_EXPRESSION();
      supporting-text=@TEMPLATE_EXPRESSION();
    >
      @TEMPLATE_EXPRESSION();
      @TEMPLATE_EXPRESSION();
      @TEMPLATE_EXPRESSION();
      <div id="description" slot="aria-describedby"></div>
    </@TEMPLATE_EXPRESSION();>
node_modules/@material/web/textfield/internal/text-field.js

Reproduction

Bundle components using Rollup + rollup-plugin-minify-html-literals without custom configuration (just calling minifyHTML.default() )

Workaround

For now I've just disabled the minifyHTML step and everything works fine.

Is this a regression?

No or unsure. This never worked, or I haven't tried before.

Affected versions

Failing in 1.x.x

Browser/OS/Node environment

Browser: Chrome 121.0.6167.184
OS: Fedora Linux 39
minify-html-literals: 1.3.5

@asyncLiz
Copy link
Collaborator

This is a known issue with the minify-html-literals plugin. There are efforts to bring it directly into lit labs and update it to support more lit features that MWC uses.

Unfortunately there's nothing actionable we can do on this project about it right now. I'd suggest following lit/lit#4273 to see if there's anything you can do to help it move along!

@asyncLiz asyncLiz closed this as not planned Won't fix, can't repro, duplicate, stale Feb 23, 2024
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