Skip to content

Build script doesn't work with the @material/mwc-elements #6

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
larsgk opened this issue Mar 29, 2019 · 2 comments
Closed

Build script doesn't work with the @material/mwc-elements #6

larsgk opened this issue Mar 29, 2019 · 2 comments

Comments

@larsgk
Copy link

larsgk commented Mar 29, 2019

Reproduce:

  • Clone repo
  • Update lit-element to latest (2.1.0)
  • Build and verify that build works (it does ;))
  • Add a component e.g. npm install @material/mwc-button & import/add in my-element
    (The element version is 0.5.0)
  • Clean and build

Two things happen:

  1. the build throws an error:
src/index.js → build/index.js...
(!) `this` has been rewritten to `undefined`
https://rollupjs.org/guide/en#error-this-is-undefined
node_modules/@material/mwc-button/mwc-button.js
1: var __decorate = this && this.__decorate || function (decorators, target, key, desc) {
                    ^
2:   var c = arguments.length,
3:       r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,
...and 1 other occurrence

and 2. the app never renders - but throws an error in the console:

util.js:43 Uncaught TypeError: Cannot read property 'appendChild' of null
    at detectEdgePseudoVarBug (util.js:43)
    at supportsCssVariables (util.js:76)
    at ripple-directive.js:26

Using the rollup script from https://open-wc.org/building/building-rollup.html works with the mwc-elements.

Also, other elements done with lit-element work (with this script).

@larsgk
Copy link
Author

larsgk commented Mar 29, 2019

Related to material-components/material-web#257

@aomarks
Copy link

aomarks commented Aug 14, 2019

I think this is more-or-less a dupe of material-components/material-web#257, and I think will be fixed if we switch to typescript's importHelpers style of polyfills, instead of using the globally-injected style.

@aomarks aomarks closed this as completed Aug 14, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants