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

v12.0.0 -- Mono repo setups and extending tsconfigs break the build #30360

Closed
akadop opened this issue Oct 26, 2021 · 2 comments · Fixed by #30355
Closed

v12.0.0 -- Mono repo setups and extending tsconfigs break the build #30360

akadop opened this issue Oct 26, 2021 · 2 comments · Fixed by #30355
Labels
bug Issue was opened via the bug report template.

Comments

@akadop
Copy link

akadop commented Oct 26, 2021

What version of Next.js are you using?

12

What version of Node.js are you using?

14.17.5

What browser are you using?

Chrome

What operating system are you using?

mac, windows

How are you deploying your application?

Vercel

Describe the Bug

Next v12 has a function that, on dev or build, will look at the tsconfig and make suggestions.

If you have a mono repo setup and the nearest tsconfig is not at the root of the repo, extending a tsconfig without the incremental config option will break the build.

Check this repro repo out:
https://github.com/akadop/next-v12-monorepo-bug

Expected Behavior

The next commands (dev, build, start) all work correctly as they have been with prior versions

To Reproduce

Check this repro repo out:
https://github.com/akadop/next-v12-monorepo-bug

To see this, just try running yarn dev without making any changes. You should see this error:

TypeError: Cannot set property 'incremental' of undefined
    at ~\v12-next-bug\node_modules\next\dist\lib\typescript\writeConfigurationDefaults.js:150:57)
    at async Object.verifyTypeScriptSetup (~\v12-next-bug\node_modules\next\dist\lib\verifyTypeScriptSetup.js:81:9)
    at async DevServer.prepare (~\v12-next-bug\node_modules\next\dist\server\dev\next-dev-server.js:262:9)
    ```

If you go into the next.config and point the tsconfigPath at the nearest tsconfig, you get the same error.

If you instead point it to the tsconfig at the root of the repo, the build has no issues

@akadop akadop added the bug Issue was opened via the bug report template. label Oct 26, 2021
@kodiakhq kodiakhq bot closed this as completed in #30355 Oct 27, 2021
kodiakhq bot pushed a commit that referenced this issue Oct 27, 2021
A tsconfig like:

```
{
  "extends": "..."
}
```

currently fails the build if the config that is extended from has not the expected configuration (and we want to update it)

Fixes: #30360
@ijjk
Copy link
Member

ijjk commented Oct 27, 2021

Hi, this has been updated in the latest version of Next.js v12.0.2-canary.1 please update and give it a try!

@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 27, 2022
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
…#30355)

A tsconfig like:

```
{
  "extends": "..."
}
```

currently fails the build if the config that is extended from has not the expected configuration (and we want to update it)

Fixes: vercel#30360
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants