Skip to content

Cannot define scriptName when the TS option "useDefineForClassFields" is false #8148

@d0rianb

Description

@d0rianb

Some libraries (like lit) require "useDefineForClassFields": false in the tsconfig.json
However, it seems to break the Script class :
The following code :

export class Annotation extends Script {
  static scriptName = 'annotation'
  ...

causes the runtime error :

Uncaught TypeError: Cannot set property scriptName of class Script extends EventHandler { ... } which has only a getter ```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions