Skip to content
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

Webpack compilation issues? #29

Closed
JMStudiosJoe opened this issue Mar 2, 2017 · 3 comments
Closed

Webpack compilation issues? #29

JMStudiosJoe opened this issue Mar 2, 2017 · 3 comments

Comments

@JMStudiosJoe
Copy link

I have been trying to use ui-router-react but can not get past webpack complaints for some reason.
ERROR in [at-loader] node_modules/ui-router-core/lib/common/common.d.ts:388:31
TS7006: Parameter 'a' implicitly has an 'any' type.

ERROR in [at-loader] node_modules/ui-router-core/lib/common/common.d.ts:388:34
TS7006: Parameter 'b' implicitly has an 'any' type.

ERROR in [at-loader] node_modules/ui-router-core/lib/resolve/resolveContext.d.ts:7:22
TS7005: Variable 'NATIVE_INJECTOR_TOKEN' implicitly has an 'any' type.

ERROR in [at-loader] node_modules/ui-router-core/lib/transition/transitionHook.d.ts:13:37
TS7006: Parameter 'error' implicitly has an 'any' type.

ERROR in [at-loader] src/components/loginComponent.tsx:23:33
TS2314: Generic type 'KeyboardEvent' requires 1 type argument(s).

ERROR in [at-loader] src/components/loginComponent.tsx:32:31
TS2314: Generic type 'KeyboardEvent' requires 1 type argument(s).

These errors (besides last two) only happen when I try to import
import {UIRouter, UIView, UISref, UISrefActive, pushStateLocationPlugin} from 'ui-router-react';

here is link to the project under branch reactRouting: https://github.com/JMStudiosJoe/ReactPractice/tree/reactRouting
any advice and help would be great, thank you in advance I hope this is just a small stupid step I missed cause this is frustrating.

@wms
Copy link
Contributor

wms commented Mar 2, 2017

@JMStudiosJoe There may be a better solution that this (the best being to fix the implicit any types in the core), but adding "skipLibCheck": true to your project's tsconfig.json should suppress these errors.

@elboman
Copy link
Member

elboman commented Mar 2, 2017

So, I took a look at the code. The problem here is the fact that the ui-router-core lib is developed with the noImplicitAny default value, which is false, while your config sets it to true. This is why the core lib compiles fine in the source but doesn't in your setup.

That being said, you can fix the problem (for now) by setting "noImplicitAny": false in your tsconfig.json and let TS deal with implicit any types, unless you prefer skipping the whole lib check and in that case you can do what @warrenseymour suggests.

I guess the core lib should support your configuration and we should make a PR to explicitly set the any type on those variables.

@JMStudiosJoe
Copy link
Author

@warrenseymour and @elboman thank you both for fast responses and both solutions worked to let you know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants