s-panferov / awesome-typescript-loader

Awesome TypeScript loader for webpack
Other
2.35k stars 179 forks source link

You're using an old webpack version #612

Closed warpdesign closed 6 years ago

warpdesign commented 6 years ago

I'm trying to build a typescript project (no tsx/react, only typescript) using webpack and I am getting this error:

Error: It looks like you're using an old webpack version without hooks support.
If you're using awesome-script-loader with React storybooks
consider upgrading @storybook/react to at least version 4.0.0-alpha.3

Since I'm not using React this is a bit misleading.

I am using typescript 3.0.1, webpack 2.3.3 and awesome_typescript_loader 5.2.1

sarink commented 6 years ago

The second statement doesn't apply to you, because you're not using awesome-typescript-loader with React storybooks. However, Error: It looks like you're using an old webpack version without hooks support. tells you everything you need to know (hint: upgrade webpack).

warpdesign commented 6 years ago

You're right: I shouldn't have care about the React stuff.

Updating to latest webpack 4.x fixes the problem.

bbugh commented 6 years ago

What is the minimal version of webpack? We're on 3.11 and getting this error. If this library works only for Webpack 4, maybe you could add that to the readme?

sarink commented 6 years ago

As with everything npm, dependency versions are listed in package.json. You can work backwards through npm releases to find a version of this lib that supports webpack v3.

sinoon commented 6 years ago

@warpdesign I checked commit history and find that you can use v4 for awesome-typescript-loader.

Suyash2810 commented 5 years ago

I am trying to build an angular+node project with webpack 4. Previously it was showing the same errors as discussed @warpdesign

I updated webpack and webpack-cli globally and locally. The project was built properly. I started the npm start script and the project opened on localhost. However now the same errors are being shown in the chrome console.

Screenshot (317)

This is the index.hbs file which is being rendered on localhost:3000.

Screenshot (318)

The webpack.config.common.js file's code is below:

Screenshot (319)

The webpack.config.dev.js is as below:

Screenshot (320)

The angular my-app component is not being loaded properly as can be seen. Any help regarding this would be appreciated.

dionisoros commented 5 years ago

My solution: I've downgrade awesome-typescriyt-loader library to ^3.5.0 version and is working.