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

default typescript plugin conflicts with ts-loader #28498

Closed
Merciful12 opened this issue Dec 5, 2020 · 4 comments
Closed

default typescript plugin conflicts with ts-loader #28498

Merciful12 opened this issue Dec 5, 2020 · 4 comments
Labels
type: bug An issue or pull request relating to a bug in Gatsby

Comments

@Merciful12
Copy link

Description

i use ts loader and after i updated gatsby i start getting errors like this #26027
I Didn't catch how to disable default babel ts compilation #26452

Steps to reproduce

start a new gatsby project and add ts-loader plugin

Expected result

should build without error

Actual result

didn't build because errors like

TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
TS7006: Parameter '_ref3' implicitly has an 'any' type.
@Merciful12 Merciful12 added the type: bug An issue or pull request relating to a bug in Gatsby label Dec 5, 2020
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 5, 2020
@Js-Brecht
Copy link
Contributor

Js-Brecht commented Dec 8, 2020

There is (supposed to be) discussion about modifying the default typescript loader here: #26984. It hasn't seen any action since that PR, however.

For right now, in onCreateWebpackConfig, you would need to strip out gatsby-plugin-typescript in order for you to be able to use ts-loader.

@Merciful12
Copy link
Author

Merciful12 commented Dec 8, 2020

@Js-Brecht For temporary solution i just resolve both plugins in order : gatsby-plugin-typescript, gatsby-plugin-ts-loader. And it works fine. How to strip out in onCreateWebpackConfig?

@Merciful12 Merciful12 changed the title default typescript plugin conflict with ts-loader default typescript plugin conflicts with ts-loader Dec 8, 2020
@Js-Brecht
Copy link
Contributor

You would need to find the rule in the webpack config that matches against *.ts files and that uses babel-loader, and remove it. That should leave the rule that uses ts-loader

@LekoArts LekoArts removed the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Dec 14, 2020
@LekoArts
Copy link
Contributor

I'll close this in favor of #26984

Thanks Js-Brecht for always helping out!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug An issue or pull request relating to a bug in Gatsby
Projects
None yet
Development

No branches or pull requests

3 participants