awesome-typescript-loader icon indicating copy to clipboard operation
awesome-typescript-loader copied to clipboard

Typescript and HMR infinite loop (Hot Module Reloading)

Open franleplant opened this issue 8 years ago • 4 comments

Hi there! Thanks a lot for this public package.

I'm experiencing some sort of weird behavior which I ultimately isolated to awesome-typescript-loader. The full details of the error with gifs and images can be found here

Switching awesome-typescript-loader for ts-loader fixes this problem.

franleplant avatar Oct 09 '17 14:10 franleplant

Experiencing the same issues as soon as I add "allowJs": true to tsconfig.json. Any suggestions except swapping it out for ts-loader?

I'm using a project generated from visual studio with the .net core 2.0 + react + webpack + typescript template.

espenbjorkeng avatar Oct 16 '17 17:10 espenbjorkeng

Good isolation of the problem, Im also using allowJs option

On Mon, Oct 16, 2017, 14:32 Espen Bjørkeng [email protected] wrote:

Experiencing the same issues as soon as i add "allowJs": true to tsconfig.json. Any suggestions except swapping it out for ts-loader?

I'm using a project generated from visual studio with the .net core 2.0 + react + webpack + typescript template.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/s-panferov/awesome-typescript-loader/issues/502#issuecomment-336962128, or mute the thread https://github.com/notifications/unsubscribe-auth/ABxEJ1DbFHqJLfB252M5vptiBb0xUy4Nks5ss5NDgaJpZM4Pyl1z .

franleplant avatar Oct 16 '17 18:10 franleplant

I came across the same issue while using the project generated from Visual Studio. I added wwwroot and ClientApp/dist to the tsconfig.json exclude list. Initial testing seems to show that it fixed the problem.

tpflueger avatar Oct 27 '17 02:10 tpflueger

I came across this issue too and adding "exclude": ["dist/**/*"], to my tsconfig seems to have solved the issue as well. Although, I'm not sure I can reason why this fixed the infinite loop. All the artifacts in my dist folder were *.js and static assets (no typescript), so it's unclear why awesome typescript loader would re-run when it's webpack test is test: /\.tsx?$/

I did not have this problem when I switched out at-loader for ts-loader

dengjonathan avatar Jul 12 '18 18:07 dengjonathan