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

Next complied success even if typescript type check error #6466

Closed
HarikiRito opened this issue Feb 27, 2019 · 10 comments
Closed

Next complied success even if typescript type check error #6466

HarikiRito opened this issue Feb 27, 2019 · 10 comments
Labels
examples Issue/PR related to examples good first issue Easy to fix issues, good for newcomers

Comments

@HarikiRito
Copy link

Examples bug report

Typescript type check error show on IDE but still complied success

Example name

custom-server-typescript

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Do anything to make typescript complain but still a valid js code (E.g let a: string = 1)

Expected behavior

Throw error on type check error

Screenshots

image

System information

  • OS: Windows
  • Browser (if applies) [e.g. chrome, safari]
  • Version of Next.js: 8.0.1

Additional context

@timneutkens timneutkens added help wanted good first issue Easy to fix issues, good for newcomers labels Feb 27, 2019
@echoulen
Copy link
Contributor

May you try to use with-ts-node example?

@HarikiRito
Copy link
Author

May you try to use with-ts-node example?

Crash on the first try. Even if this work I still need some babel plugin for the project and this example doesn't use babel

@nblthree
Copy link
Contributor

nblthree commented Mar 5, 2019

Setting "strict": true in tsconfig.json seems that it reports errors only in server/index.ts

@timneutkens timneutkens added the examples Issue/PR related to examples label Mar 9, 2019
@crutchcorn
Copy link
Contributor

I will be fixing this as part of updating almost all of the examples

@azizhk
Copy link
Contributor

azizhk commented Mar 18, 2019

@zeit/next-typescript uses @babel/plugin-transform-typescript which does not type check input.

Does not type-check its input. For that, you will need to install and set up TypeScript.

If you want to see errors in your terminal then you can set up fork-ts-checker-webpack-plugin.

Or if you completely want to prevent build, you can use awesome-typescript-loader or ts-loader

@martpie
Copy link
Contributor

martpie commented May 5, 2019

I don't think this is a bug: babel-typescript only strip types but does not run type checking at all, so this is the intended behavior.

As @azizhk said, if you want the build to fail, you'll need to use fork-ts-checker-webpack-plugin

@nhooyr
Copy link

nhooyr commented May 13, 2019

I'm using fork-ts-checker-webpack-plugin, I see errors in the console, but the build does not fail. I followed the example guide to set it up.

Screen Shot 2019-05-13 at 12 36 40 PM

@Timer
Copy link
Member

Timer commented May 13, 2019

This has been implemented in the latest Next.js canary version. You can try it by installing next@canary!

@kachkaev
Copy link
Contributor

Reverse issue: #7687 😁

@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 31, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
examples Issue/PR related to examples good first issue Easy to fix issues, good for newcomers
Projects
None yet
Development

No branches or pull requests