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

Extraneous compile errors when using checkJs/allowJs #577

Closed
OliverJAsh opened this issue Jul 3, 2017 · 2 comments
Closed

Extraneous compile errors when using checkJs/allowJs #577

OliverJAsh opened this issue Jul 3, 2017 · 2 comments

Comments

@OliverJAsh
Copy link

OliverJAsh commented Jul 3, 2017

When using the checkJs/allowJs TS compiler options and compiling via ts-loader, I am getting extraneous compile errors (as compared to running tsc standalone).

I have created a small test case here where you can try this for yourself, with the simplest possible reproduction case: https://github.com/OliverJAsh/ts-loader-check-js

Run tsc and you will get one compile error, but run webpack and you will get many more—all from within node_modules.

Example

If I only enable allowJs. Here we have extraneous errors from TS declaration files within node_modules:

ERROR in /Users/OliverJAsh/Development/temp/ts-loader-check-js/node_modules/@types/react-redux/index.d.ts
(14,23): error TS2694: Namespace '"/Users/OliverJAsh/Development/temp/ts-loader-check-js/node_modules/redux/es/index"' has no exported member 'Store'.

ERROR in /Users/OliverJAsh/Development/temp/ts-loader-check-js/node_modules/@types/react-redux/index.d.ts
(15,26): error TS2694: Namespace '"/Users/OliverJAsh/Development/temp/ts-loader-check-js/node_modules/redux/es/index"' has no exported member 'Dispatch'.

…

If I enable both allowJs and checkJs. Here we have extraneous errors from JS files within node_modules:

ERROR in /Users/OliverJAsh/Development/temp/ts-loader-check-js/node_modules/redux/es/applyMiddleware.js
(1,23): error TS2339: Property 'assign' does not exist on type 'ObjectConstructor'.

ERROR in /Users/OliverJAsh/Development/temp/ts-loader-check-js/node_modules/redux/es/combineReducers.js
(75,9): error TS2304: Cannot find name 'process'.

…

If I run tsc --noEmit. This error is expected and not extraneous, unlike others.

tsc
node_modules/@types/react-redux/index.d.ts(179,31): error TS2314: Generic type 'Component<P, S>' requires 2 type argument(s).
@bsouthga
Copy link

looks related to this: #586

@johnnyreilly
Copy link
Member

Closed with #590

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