Skip to content

npm run build typescript compile errors #4482

@btakita

Description

@btakita

When running npm run build

> [email protected] tsd /home/brian/work/sveltejs/svelte
> tsc -p src/compiler --emitDeclarationOnly && tsc -p src/runtime --emitDeclarationOnly

src/compiler/compile/Component.ts:242:16 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

242                                     if (node.name[0] === '@') {
                                                 ~~~~

src/compiler/compile/Component.ts:243:17 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

243                                             if (node.name[1] === '_') {
                                                         ~~~~

src/compiler/compile/Component.ts:244:40 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

244                                                     const alias = this.global(node.name.slice(2));
                                                                                       ~~~~

src/compiler/compile/Component.ts:245:14 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

245                                                     node.name = alias.name;
                                                             ~~~~

src/compiler/compile/Component.ts:247:25 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

247                                                     let name = node.name.slice(1);
                                                                        ~~~~

src/compiler/compile/Component.ts:259:14 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

259                                                     node.name = alias.name;
                                                             ~~~~

src/compiler/compile/Component.ts:263:21 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

263                                     else if (node.name[0] !== '#' && !is_valid(node.name)) {
                                                      ~~~~

src/compiler/compile/Component.ts:263:55 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

263                                     else if (node.name[0] !== '#' && !is_valid(node.name)) {
                                                                                        ~~~~

src/compiler/compile/Component.ts:265:64 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

265                                             const literal: Literal = { type: 'Literal', value: node.name };
                                                                                                        ~~~~

src/compiler/compile/Component.ts:268:16 - error TS2339: Property 'key' does not exist on type 'BaseNode'.

268                                                     parent.key = literal;
                                                               ~~~

src/compiler/compile/Component.ts:272:16 - error TS2339: Property 'property' does not exist on type 'BaseNode'.

272                                                     parent.property = literal;
                                                               ~~~~~~~~

src/compiler/compile/Component.ts:273:16 - error TS2339: Property 'computed' does not exist on type 'BaseNode'.

273                                                     parent.computed = true;
                                                               ~~~~~~~~

src/compiler/compile/Component.ts:527:50 - error TS2339: Property 'label' does not exist on type 'BaseNode'.

527                     if (node.type === 'LabeledStatement' && node.label.name === '$') {
                                                                     ~~~~~

src/compiler/compile/Component.ts:721:17 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

721                     if (map.has(node)) {
                                    ~~~~

src/compiler/compile/Component.ts:722:22 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

722                             scope = map.get(node);
                                                ~~~~

src/compiler/compile/Component.ts:765:17 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

765                     if (map.has(node)) {
                                    ~~~~

src/compiler/compile/Component.ts:801:17 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

801                     if (map.has(node)) {
                                    ~~~~

src/compiler/compile/Component.ts:802:22 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

802                             scope = map.get(node);
                                                ~~~~

src/compiler/compile/Component.ts:806:67 - error TS2339: Property 'left' does not exist on type 'BaseNode'.

806                             const assignee = node.type === 'AssignmentExpression' ? node.left : node.argument;
                                                                                             ~~~~

src/compiler/compile/Component.ts:806:79 - error TS2339: Property 'argument' does not exist on type 'BaseNode'.

806                             const assignee = node.type === 'AssignmentExpression' ? node.left : node.argument;
                                                                                                         ~~~~~~~~

src/compiler/compile/Component.ts:819:30 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

819                     if (is_used_as_reference(node, parent)) {
                                                 ~~~~

src/compiler/compile/Component.ts:820:32 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

820                             const object = get_object(node);
                                                          ~~~~

src/compiler/compile/Component.ts:829:17 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

829                     if (map.has(node)) {
                                    ~~~~

src/compiler/compile/Component.ts:897:17 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

897                     if (map.has(node)) {
                                    ~~~~

src/compiler/compile/Component.ts:898:22 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

898                             scope = map.get(node);
                                                ~~~~

src/compiler/compile/Component.ts:902:15 - error TS2339: Property 'kind' does not exist on type 'BaseNode'.

902                             if (node.kind === 'var' || scope === instance_scope) {
                                         ~~~~

src/compiler/compile/Component.ts:903:12 - error TS2339: Property 'declarations' does not exist on type 'BaseNode'.

903                                     node.declarations.forEach(declarator => {
                                             ~~~~~~~~~~~~

src/compiler/compile/Component.ts:970:17 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

970                     if (map.has(node)) {
                                    ~~~~

src/compiler/compile/Component.ts:974:56 - error TS2339: Property 'declaration' does not exist on type 'BaseNode'.

974                     if (node.type === 'ExportNamedDeclaration' && node.declaration) {
                                                                           ~~~~~~~~~~~

src/compiler/compile/Component.ts:975:45 - error TS2339: Property 'declaration' does not exist on type 'BaseNode'.

975                             (parent as Program).body[index] = node.declaration;
                                                                       ~~~~~~~~~~~

src/compiler/compile/Component.ts:1073:18 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

1073                            if (map.has(node)) {
                                            ~~~~

src/compiler/compile/Component.ts:1074:23 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

1074                                    scope = map.get(node);
                                                        ~~~~

src/compiler/compile/Component.ts:1078:42 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

1078                                    const { name } = flatten_reference(node);
                                                                           ~~~~

src/compiler/compile/Component.ts:1119:18 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

1119                            if (map.has(node)) {
                                            ~~~~

src/compiler/compile/Component.ts:1162:19 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

1162                                    if (map.has(node)) {
                                                    ~~~~

src/compiler/compile/Component.ts:1163:24 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

1163                                            scope = map.get(node);
                                                                ~~~~

src/compiler/compile/Component.ts:1167:37 - error TS2339: Property 'left' does not exist on type 'BaseNode'.

1167                                            const left = get_object(node.left);
                                                                             ~~~~

src/compiler/compile/Component.ts:1174:17 - error TS2339: Property 'operator' does not exist on type 'BaseNode'.

1174                                            if (node.operator !== '=') {
                                                         ~~~~~~~~

src/compiler/compile/Component.ts:1178:43 - error TS2339: Property 'argument' does not exist on type 'BaseNode'.

1178                                            const identifier = get_object(node.argument);
                                                                                   ~~~~~~~~

src/compiler/compile/Component.ts:1181:38 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

1181                                            const identifier = get_object(node);
                                                                              ~~~~

src/compiler/compile/Component.ts:1202:19 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

1202                                    if (map.has(node)) {
                                                    ~~~~

src/compiler/compile/nodes/Let.ts:34:23 - error TS2339: Property 'name' does not exist on type 'BaseNode'.

34                                      names.push(node.name);
                                                        ~~~~

src/compiler/compile/nodes/shared/Expression.ts:147:17 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

147                     if (map.has(node)) {
                                    ~~~~

src/compiler/compile/nodes/shared/Expression.ts:341:11 - error TS2322: Type 'BaseNode' is not assignable to type 'Node'.
  Type 'BaseNode' is missing the following properties from type 'ExportSpecifier': exported, local

341     return (this.manipulated = node);
                ~~~~~~~~~~~~~~~~

src/compiler/compile/render_dom/index.ts:199:17 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

199                     if (map.has(node)) {
                                    ~~~~

src/compiler/compile/render_dom/index.ts:200:22 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

200                             scope = map.get(node);
                                                ~~~~

src/compiler/compile/render_dom/index.ts:205:17 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

205                     if (map.has(node)) {
                                    ~~~~

src/compiler/compile/render_dom/index.ts:210:67 - error TS2339: Property 'left' does not exist on type 'BaseNode'.

210                             const assignee = node.type === 'AssignmentExpression' ? node.left : node.argument;
                                                                                             ~~~~

src/compiler/compile/render_dom/index.ts:210:79 - error TS2339: Property 'argument' does not exist on type 'BaseNode'.

210                             const assignee = node.type === 'AssignmentExpression' ? node.left : node.argument;
                                                                                                         ~~~~~~~~

src/compiler/compile/render_dom/index.ts:218:47 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

218                             this.replace(invalidate(renderer, scope, node, names));
                                                                         ~~~~

src/compiler/compile/render_dom/wrappers/EachBlock.ts:236:22 - error TS2345: Argument of type '{ block: Block; parent_node: Identifier; parent_nodes: Identifier; snippet: BaseNode; initial_anchor_node: Identifier; initial_mount_node: Identifier; update_anchor_node: Identifier; update_mount_node: Identifier; }' is not assignable to parameter of type '{ block: Block; parent_node: Identifier; parent_nodes: Identifier; snippet: Node; initial_anchor_node: Identifier; initial_mount_node: Identifier; update_anchor_node: Identifier; update_mount_node: Identifier; }'.
  Types of property 'snippet' are incompatible.
    Type 'BaseNode' is not assignable to type 'Node'.
      Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

236             this.render_keyed(args);
                                  ~~~~

src/compiler/compile/render_dom/wrappers/EachBlock.ts:238:24 - error TS2345: Argument of type '{ block: Block; parent_node: Identifier; parent_nodes: Identifier; snippet: BaseNode; initial_anchor_node: Identifier; initial_mount_node: Identifier; update_anchor_node: Identifier; update_mount_node: Identifier; }' is not assignable to parameter of type '{ block: Block; parent_nodes: Identifier; snippet: Node; initial_anchor_node: Identifier; initial_mount_node: Identifier; update_anchor_node: Identifier; update_mount_node: Identifier; }'.
  Types of property 'snippet' are incompatible.
    Type 'BaseNode' is not assignable to type 'Node'.
      Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

238             this.render_unkeyed(args);
                                    ~~~~

src/compiler/compile/render_dom/wrappers/Element/Binding.ts:56:3 - error TS2322: Type 'BaseNode' is not assignable to type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

56      this.snippet = this.node.expression.manipulate(block);
        ~~~~~~~~~~~~

src/compiler/compile/render_dom/wrappers/shared/Tag.ts:39:57 - error TS2345: Argument of type 'BaseNode' is not assignable to parameter of type 'Node'.
  Type 'BaseNode' is not assignable to type 'ExportSpecifier'.

39      if (this.node.should_cache) block.add_variable(value, snippet); // TODO may need to coerce snippet to string
                                                              ~~~~~~~


Found 54 errors.

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