Repository navigation
e2e error: TSError: Unable to compile TypeScript #452
Copy link
Copy link
Closed
Description
- I'm submitting a ...
[x ] bug report
[ ] feature request
[ ] question about the decisions made in the repository - Do you want to request a feature or report a bug?
Bug - What is the current behavior?
Runningnpm e2efails. - If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via
https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
Run npm pree2e (works fine)
Run npm e2e and get this error:
root directory:/Path/To/angular2-webpack-starter-master
Using ChromeDriver directly...
[launcher] Running 1 instances of WebDriver
[launcher] Error: TSError: ⨯ Unable to compile TypeScript
node_modules/zone.js/lib/browser/property-descriptor.ts (65,19): Cannot find name 'Zone'. (2304)
node_modules/zone.js/lib/browser/register-element.ts (24,32): Cannot find name 'Zone'. (2304)
node_modules/zone.js/lib/browser/register-element.ts (27,40): Cannot find name 'Zone'. (2304)
node_modules/zone.js/lib/browser/register-element.ts (30,38): Cannot find name 'Zone'. (2304)
node_modules/zone.js/lib/browser/utils.ts (3,51): Cannot find name 'Zone'. (2304)
node_modules/zone.js/lib/browser/utils.ts (9,17): Cannot find name 'Zone'. (2304)
node_modules/zone.js/lib/browser/utils.ts (101,36): Cannot find name 'TaskData'. (2304)
node_modules/zone.js/lib/browser/utils.ts (110,55): Cannot find name 'Task'. (2304)
node_modules/zone.js/lib/browser/utils.ts (111,19): Cannot find name 'Task'. (2304)
node_modules/zone.js/lib/browser/utils.ts (131,56): Cannot find name 'Task'. (2304)
node_modules/zone.js/lib/browser/utils.ts (132,19): Cannot find name 'Task'. (2304)
node_modules/zone.js/lib/browser/utils.ts (139,43): Cannot find name 'Task'. (2304)
node_modules/zone.js/lib/browser/utils.ts (146,41): Cannot find name 'Task'. (2304)
node_modules/zone.js/lib/browser/utils.ts (172,18): Cannot find name 'Task'. (2304)
node_modules/zone.js/lib/browser/utils.ts (178,13): Cannot find name 'Zone'. (2304)
node_modules/zone.js/lib/browser/utils.ts (178,20): Cannot find name 'Zone'. (2304)
node_modules/zone.js/lib/browser/utils.ts (248,49): Cannot find name 'Zone'. (2304)
src/polyfills.ts (54,14): Cannot find name 'Zone'. (2304)
src/polyfills.ts (75,32): Cannot find name 'TaskData'. (2304)
src/polyfills.ts (89,31): Cannot find name 'Task'. (2304)
src/polyfills.ts (96,28): Cannot find name 'Task'. (2304)
src/polyfills.ts (105,18): Cannot find name 'Zone'. (2304)
src/polyfills.ts (108,9): Type '{ handleId: null; isPeriodic: boolean; delay: any; args: any[]; }' is not assignable to type 'TimerOptions'.
Object literal may only specify known properties, and 'isPeriodic' does not exist in type 'TimerOptions'. (2322)
src/polyfills.ts (120,15): Cannot find name 'Task'. (2304)
at getOutput (/Path/To/angular2-webpack-starter-master/node_modules/ts-node/src/ts-node.ts:209:13)
at Object.loader (/Path/To/angular2-webpack-starter-master/node_modules/ts-node/src/ts-node.ts:224:23)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:311:12)
at Module.require (module.js:366:17)
at require (module.js:385:17)
at/Path/To/angular2-webpack-starter-master/node_modules/protractor/node_modules/jasmine/lib/jasmine.js:71:5
at Array.forEach (native)
at Jasmine.loadSpecs (/Path/To/angular2-webpack-starter-master/node_modules/protractor/node_modules/jasmine/lib/jasmine.js:70:18)
at Jasmine.execute (/Path/To/angular2-webpack-starter-master/node_modules/protractor/node_modules/jasmine/lib/jasmine.js:154:8)
[launcher] Process exited with error code 100
- What is the expected behavior?
e2e tests should run. - What is the motivation / use case for changing the behavior?
Being able to run e2e tests. - Please tell us about your environment:
- Angular version: 2.0.0-beta.11
- Browser: Chrome 49.0.2623.87 (64-bit)
- OS X
- Node 4.2.1
- Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)
Running latest from master as of now, still seeing this issue. Not sure when it started.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
Tjeerd-menno commentedon Mar 23, 2016
I'm getting the same error
Node 5.6.0
TypeScript 1.8.9
Windows 7 (64-bit)
Could it be related to this Angular 2 issue? angular/angular#7660
vdavyskiba commentedon Mar 23, 2016
Occure same issue:
source:
import {describe, it, beforeEach, expect} from 'angular2/testing';
describe('App', () => {
beforeEach(() => {
});
});
Ouput:
D:\VITALY\work\angular2\angular2-webpack-starter>npm run e2eselenium standalone is up to date.
chromedriver is up to date.
Using FirefoxDriver directly...
[launcher] Running 1 instances of WebDriver
? Unable to compile TypeScript
src\webapp\pages\app\app.e2e.ts (7,5): Cannot find name 'browser'. (2304)
src\webapp\pages\app\app.e2e.ts (13,19): Cannot find name 'browser'. (2304)
src\webapp\pages\app\app.e2e.ts (23,19): Cannot find name 'element'. (2304)
src\webapp\pages\app\app.e2e.ts (23,27): Cannot find name 'by'. (2304)
chuson1996 commentedon Mar 24, 2016
Same here
tobek commentedon Mar 27, 2016
Issue is described here angular/angular#7660 and looks like it will be fixed in a future release of angular. In the mean time you can fix it by adding this to your
tsconfig.json:aegyed91 commentedon Mar 27, 2016
@tobek thanks, the compiler needs
zone.js.d.tsbut, its not that easy to fix it, because if you check the current tsconfig.json node_modules are excluded, even if you add
./node_modules/zone.js/dist/zone.js.d.tstofilesGlobit won't gain any precedence over the node_modules exclusion. If you remove the node_modules exclusion you will get a bunch of duplicate identifier errorsNevertheless
./src/custom-typings.d.tsis not a wise decision:./node_modules/zone.js/dist/zone.js.d.ts?I think it would be wiser to create
./manual-typings/and place all the custom.d.tsfile there and load this folder. This is where i added the missingzone.js.d.tsfile. So, something like this.tobek commentedon Mar 27, 2016
That definitely seems like a more elegant/maintainable long-term solution, however it seems like the fix on angular's end is coming soon so hopefully we won't have to deal with this (and ideally shouldn't have to). My hack solution above worked for me as a temporary fix until the angular team fixes this.
StormToft commentedon Apr 2, 2016
Closing this because this issue no longer occurs in master at bf46a9c. Thanks all!