question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error on Object Rest/Spread Properties syntax

See original GitHub issue

OS?

Ubuntu 16.04

Versions.

angular-cli: 1.0.0-beta.26
node: 6.8.1
os: linux x64
@angular/common: 2.4.4
@angular/compiler: 2.4.4
@angular/compiler-cli: 2.4.4
@angular/core: 2.4.4
@angular/forms: 2.4.4
@angular/http: 2.4.4
@angular/material: 2.0.0-beta.0
@angular/platform-browser: 2.4.4
@angular/platform-browser-dynamic: 2.4.4
@angular/router: 3.4.4

Repro steps.

Use Object Rest/Spread Properties syntax inside any file:

let a = { ...b, c };

The log given by the failure.

ERROR in ./src/app/app.component.ts
Module build failed: TypeError: Cannot read property 'kind' of undefined
    at _getContentOfKeyLiteral (/home/sergey/ng2-project/node_modules/@ngtools/webpack/src/loader.js:8:13)
    at /home/sergey/ng2-project/node_modules/@ngtools/webpack/src/loader.js:83:62
    at Array.some (native)
    at /home/sergey/ng2-project/node_modules/@ngtools/webpack/src/loader.js:83:32
    at Array.filter (native)
    at _removeModuleId (/home/sergey/ng2-project/node_modules/@ngtools/webpack/src/loader.js:82:10)
    at /home/sergey/ng2-project/node_modules/@ngtools/webpack/src/loader.js:167:48
 @ ./src/app/app.module.ts 8:0-89

Mention any other details that might be useful.

I didn’t have this error when using angular-cli: 1.0.0-beta.24. Looks like it started failing after fix #4078.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
intellixcommented, Jan 23, 2017

Object Rest/Spread is only supported in TS 2.1 and Angular don’t officially support that yet 😃

0reactions
angular-automatic-lock-bot[bot]commented, Sep 7, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Spread syntax (...) - JavaScript - MDN Web Docs - Mozilla
In an object literal, the spread syntax enumerates the properties of an object and adds the key-value pairs to the object being created....
Read more >
An Easy Guide to Object Rest/Spread Properties in JavaScript
Object spread syntax within the object literal extracts from source objects own and enumerable properties, and copies them into the target ...
Read more >
JavaScript Object Destructuring, Spread Syntax, and the Rest ...
JavaScript Object Destructuring is the syntax for extracting values from an object property and assigning them to a variable.
Read more >
ECMAScript - Object Rest/Spread Properties in ES2018 (ES9)
This proposal provides the ability to use rest and spread operators on top of objects. Object Destructuring. Analogously to the array - when ......
Read more >
babel/plugin-syntax-object-rest-spread
Syntax only​​ It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use plugin-proposal-object-rest-spread...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found