question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

next build stuck on "Checking validity of types..."

See original GitHub issue

What version of Next.js are you using?

12.0.3

What version of Node.js are you using?

16.11.0

What browser are you using?

Chrome

What operating system are you using?

Linux

How are you deploying your application?

Vercel

Describe the Bug

next build keeps getting stuck on " Checking validity of types…" forever. I tried downgrading next’s version to 10.1.3 (my previous project uses this version and the build command works) but it still has the same issue.

Expected Behavior

next build should generate the build files.

To Reproduce

  1. Clone this repo
  2. cd into the client directory and run yarn build (make sure ignoreBuildErrors is set to false in the next config) The console shows "Checking validity of types… "

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
balazsorban44commented, Dec 4, 2021

We tried profiling the build process in terms of both memory and CPU usage first which showed unusual numbers, but we couldn’t figure out where the issue was.

So I started manually trying to remove all file files first, and slowly adding them back until it froze the build process. At the end, whenever I toggled that extends, I could reproduce the problem consistently.

I saw your post on mui. I recommend you give them as much information as possible in the description itself to help them help you much faster.

1reaction
balazsorban44commented, Dec 3, 2021

Hi @karan316 upon inspection, I have found multiple errors that would fail the compilation:

image

What freezes up the type checking though seems to be coming from here, when extends MaterialButtonProps is used:

https://github.com/karan316/Placement-Portal/blob/dabe17073c5d4267be8feb3c0cedcf5b2fd5701c/client/components/Button/index.tsx#L2-L10

I’m not really sure yet why that would be an issue, as changing the marked section to this will pass the type checking:

import MaterialButton, { LoadingButtonProps as MaterialButtonProps } from "@mui/lab/LoadingButton";
import { styled } from "@mui/system";

interface ButtonProps { // <- notice I removed the extends part
	text: string;
	rounded?: boolean;
}

const Button = ({ text, variant, onClick, rounded, ...props }: ButtonProps & any) => {

I recommend you post this at https://github.com/mui-org/material-ui as well and link back to this issue. They might have an idea of why this is happening.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Next Build hangs forever - Stack Overflow
Removed all of them and next build runs ... I was testing using v8.12.2 and it always keep in "Checking validity of types"....
Read more >
Ignoring TypeScript Errors - next.config.js
js fails your production build ( next build ) when TypeScript errors are present in your project. If you'd like Next.js to dangerously...
Read more >
Catch TypeScript Errors in Next.js Before Building Your App
A manual solution. One solution is to remember to manually run next build before every git commit, because next build seems to catch...
Read more >
Consistently fails to deploy to Vercel. Checks "validity of types ...
Consistently fails to deploy to Vercel. Checks "validity of types" and then says "Failed to compile" : r/nextjs.
Read more >
Troubleshooting CI/CD - GitLab Docs
CI/CD troubleshooting rails console commands · Cancel stuck pending pipelines · Try merge request integration · Validate the .gitlab-ci.yml file · Disable ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found