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

[bug] Cannot find name 'ClassDescriptor' (v0.7.0) #428

Closed
6 tasks
lacolaco opened this issue Jan 11, 2019 · 2 comments
Closed
6 tasks

[bug] Cannot find name 'ClassDescriptor' (v0.7.0) #428

lacolaco opened this issue Jan 11, 2019 · 2 comments

Comments

@lacolaco
Copy link

Description

When I use decorators of LitElement, TypeScript compiler emits errors.

ERROR in [at-loader] ./node_modules/@polymer/lit-element/lib/decorators.d.ts:37:105
    TS2304: Cannot find name 'ClassDescriptor'.

ERROR in [at-loader] ./node_modules/@polymer/lit-element/lib/decorators.d.ts:43:118
    TS2304: Cannot find name 'ClassElement'.

ERROR in [at-loader] ./node_modules/@polymer/lit-element/lib/decorators.d.ts:48:80
    TS2304: Cannot find name 'ClassElement'.

ERROR in [at-loader] ./node_modules/@polymer/lit-element/lib/decorators.d.ts:53:83
    TS2304: Cannot find name 'ClassElement'.

It looks a bug. env.d.ts is only accessible from LitElement source code.
https://github.com/Polymer/lit-element/blob/master/src/env.d.ts

Live Demo

https://stackblitz.com/edit/lit-element-example?file=index.js

https://glitch.com/edit/#!/hello-lit-element?path=index.html:1:0

Steps to Reproduce

  1. Install v0.7.0
  2. Use @property() in TypeScript
  3. Execute tsc

Expected Results

No errors.

Actual Results

Error is thrown

Browsers Affected

  • Chrome
  • Firefox
  • Edge
  • Safari 11
  • Safari 10
  • IE 11

Versions

  • lit-element: v0.7.0
  • webcomponents: vX.X.X
@abdonrd
Copy link
Contributor

abdonrd commented Jan 11, 2019

Related: Polymer/pwa-starter-kit#316

@motss
Copy link

motss commented Jan 11, 2019

FWIW, there is also another error.

error TS2304: Cannod find name 'Constructor'.

motss added a commit to motss/app-datepicker that referenced this issue Jan 11, 2019
The latest update introduces [Constructible Stylesheets][cs-url] via
`static get styles()`. All codes have been refactored to use that for
declaring styles with shareable styles. However this blocks TS
compilation due to unsupported types of the new API which has yet to be
implemented into browsers except being enabled by default in latest
Chrome Canary 73. To learn more about the issue, please visit
lit/lit-element#428.

[cs-url]: https://www.chromestatus.com/feature/5394843094220800
@justinfagnani justinfagnani self-assigned this Jan 11, 2019
motss added a commit to motss/app-datepicker that referenced this issue Jan 12, 2019
Latest `lit-element` has fixed a known issue where missing types are not
exported thus breaks TS compilation for many users. To learn more about
the issue, please visit lit/lit-element#428.

`@material/mwc-button` has been updated to latest `lit-element` too.
Reinstalled to make the buttons work again!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants