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

@types does not work since v3 #661

Closed
Pajn opened this issue Oct 18, 2017 · 4 comments
Closed

@types does not work since v3 #661

Pajn opened this issue Oct 18, 2017 · 4 comments

Comments

@Pajn
Copy link
Contributor

Pajn commented Oct 18, 2017

Since version 3 I can no longer use type definitions from @types packages.
For example I get this error from @types/webpack:

/Users/rasmus/Development/project/node_modules/@types/webpack/index.d.ts
[tsl] ERROR in /Users/rasmus/Development/project/node_modules/@types/webpack/index.d.ts(14,26)
      TS7016: Could not find a declaration file for module 'tapable'. '/Users/rasmus/Development/project/node_modules/tapable/lib/Tapable.js' implicitly has an 'any' type.
  Try `npm install @types/tapable` if it exists or add a new declaration (.d.ts) file containing `declare module 'tapable';`

@types/tapable is installed as a dependency of @types/webpack and its files looks good but I have tried with explicitly installing it as well with the same result.

It is not an error with the @types/webpack package because if I work around that one I get a similar error from @types/uglify. It seems like any @types package that import other modules is broken.

If I compile using tsc or ts-loader 2.3.7 there are no errors, neither does vscode report any errors.
My webpack configuration is super simple:

          {
            test: /\.(ts|tsx)$/,
            include: paths.appSrc,
            use: [
              {
                loader: require.resolve('babel-loader'),
                options: {
                  cacheDirectory: true,
                },
              },
              require.resolve('ts-loader'),
            ],
          }
@Pajn
Copy link
Contributor Author

Pajn commented Oct 18, 2017

Duplicate of #657

@Pajn Pajn closed this as completed Oct 18, 2017
@johnnyreilly
Copy link
Member

Just released v3.0.3 - check it out and let me know how it goes.

@Pajn
Copy link
Contributor Author

Pajn commented Oct 18, 2017

3.0.3 works fine 👍

@johnnyreilly
Copy link
Member

Great!

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

2 participants