Skip to content

Error on Object Rest/Spread Properties syntax #4178

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

Closed
aksyonov opened this issue Jan 23, 2017 · 5 comments
Closed

Error on Object Rest/Spread Properties syntax #4178

aksyonov opened this issue Jan 23, 2017 · 5 comments

Comments

@aksyonov
Copy link

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.

@intellix
Copy link
Contributor

Object Rest/Spread is only supported in TS 2.1 and Angular don't officially support that yet :)

@filipesilva
Copy link
Contributor

Closing as answered.

@aksyonov
Copy link
Author

As a matter of fact, Angular supports TS 2.1 - in version 2.4.2 one of changes is support TypeScript 2.1, that's probably partial support, but still my application worked well with TS 2.1 and angular-cli: 1.0.0-beta.24 until I updated angular-cli to 1.0.0-beta.26.

@stevenjob
Copy link

Any update on this?

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants