Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

Webpack introduction provides an invalid sample #3198

Closed
Deilan opened this issue Feb 5, 2017 · 7 comments
Closed

Webpack introduction provides an invalid sample #3198

Deilan opened this issue Feb 5, 2017 · 7 comments

Comments

@Deilan
Copy link

Deilan commented Feb 5, 2017

https://angular.io/docs/ts/latest/guide/webpack.html

After all the steps in the article the app won't start using npm start because of the following errors:

94% asset optimization
[at-loader] Checking started in a separate process...

[at-loader] Checking finished with 77 errors
chunk    {0} vendor.js (vendor) 2.97 MB {2} [initial] [rendered]
chunk    {1} app.js, app.css (app) 3.11 kB {0} [initial] [rendered]
chunk    {2} polyfills.js (polyfills) 501 kB [entry] [rendered]

ERROR in [at-loader] node_modules\@angular\common\src\directives\ng_class.d.ts:48:34
    TS2304: Cannot find name 'Set'.

ERROR in [at-loader] node_modules\@angular\common\src\pipes\async_pipe.d.ts:44:38
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] node_modules\@angular\compiler\src\aot\compiler.d.ts:32:38
    TS2304: Cannot find name 'Promise'.

ERROR in [at-loader] node_modules\@angular\compiler\src\aot\compiler.d.ts:44:32
    TS2304: Cannot find name 'Map'.

...
@Foxandxss
Copy link
Member

Closing, there is a PR to fix it.

Thanks for the report.

@Rinkink
Copy link

Rinkink commented Feb 13, 2017

Thank you. I have the same issue. Can you link to the PR / fix please?

@Rinkink
Copy link

Rinkink commented Feb 13, 2017

Got it, this one -#3233, right?

I had a further issue:

[at-loader] Checking finished with 3 errors
chunk    {0} vendor.js (vendor) 2.97 MB {2} [initial] [rendered]
chunk    {1} app.js, app.css (app) 3.57 kB {0} [initial] [rendered]
chunk    {2} polyfills.js (polyfills) 501 kB [entry] [rendered]

ERROR in [at-loader] node_modules\@types\jasmine\index.d.ts:39:52
    TS1005: '=' expected.

ERROR in [at-loader] node_modules\@types\jasmine\index.d.ts:39:38
    TS2371: A parameter initializer is only allowed in a function or constructor implementation.

ERROR in [at-loader] node_modules\@types\jasmine\index.d.ts:39:46
    TS2304: Cannot find name 'keyof'.

In order to address this, I upgraded TypeScript to 2.1.6 as advised in DefinitelyTyped/DefinitelyTyped#14569

-    "typescript": "~2.0.10",
+    "typescript": ">=2.1.0",

@Foxandxss
Copy link
Member

You need to fix the @types/jasmine types. I did that on the repo, so check what version are we using.

Typescript 2.1 doesn't work with AOT until Angular v4.

About the PR, I had to close it, involves more steps and I will do that today.

@noomorph
Copy link

noomorph commented Feb 13, 2017

@Rinkink , instead of >=2.1.0 I recommend ^2.1.0 (upgrade to the latest minor version of 2), otherwise in some far-far future you'll have a dramatic version bump between TypeScript 2 and 3. It is not critical anyway, just a small suggestion.

@Rinkink
Copy link

Rinkink commented Feb 13, 2017

Cool, thanks. Locked the @types/jasmine in package.json:

-     "@types/jasmine": "^2.5.35",
+    "@types/jasmine": "2.5.41",

and set the Typescript version back:

-    "typescript": ">=2.1.0",
+    "typescript": "~2.0.10",

Everything seems to be working...

Thank you for your work!

@Rinkink
Copy link

Rinkink commented Feb 13, 2017

@noomorph Thank you, will change the ref, only saw your response after my previous reply.

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