Skip to content

[NEXT-792] dont add duplicate paths to tsconfig.json#include #46845

Description

@stefanprobst

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Operating System:
      Platform: linux
      Arch: x64
      Version: #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023
    Binaries:
      Node: 18.14.0
      npm: 9.3.1
      Yarn: 1.22.19
      pnpm: 7.28.0
    Relevant packages:
      next: 13.2.4-canary.4
      eslint-config-next: 13.2.3
      react: 18.2.0
      react-dom: 18.2.0

Which area(s) of Next.js are affected? (leave empty if unsure)

CLI (create-next-app)

Link to the code that reproduces this issue

if necessary i will create one

To Reproduce

  • pnpm create next-app . --experimental-app
  • edit tsconfig.json and change ".next/types/**/*.ts" to "./.next/types/**/*.ts"
  • pnpm run dev
  • cat tsconfig.json, which has:
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx",
    "./.next/types/**/*.ts",
    ".next/types/**/*.ts"
  ],

Describe the Bug

next.js automatically adds .next/types/**/*.ts to tsconfig.json#include.

however, it also does this when i already have ./.next/types/**/*.ts in tsconfig.json#include. (note that this path starts with ./)

Expected Behavior

next.js should avoid adding duplicate entries to tsconfig.json#include

Which browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

No response

NEXT-792

Activity

  1. added
    bugIssue was opened via the bug report template.
    on Mar 6, 2023
  2. taep96 commented on Mar 6, 2023

    @taep96
    Contributor

    Tried finding the commit that causes this but closest I could get is somewhere between 13.2.1 and 13.2.2

  3. AugustsK commented on Mar 7, 2023

    @AugustsK

    It seems that its the following change -> b6b7933

    Previously verifyTypeScriptSetup was executed only on build. This commit adds it to next lint as well, but the distDir argument differs to what is passed during build.

  4. changed the title [-]dont add duplicate paths to tsconfig.json#include[/-] [+][NEXT-792] dont add duplicate paths to tsconfig.json#include[/+] on Mar 7, 2023
  5. chungweileong94 commented on Mar 8, 2023

    @chungweileong94
    Contributor

    Yeah, it's somewhat annoying, especially when my codebase is in an external volume/drive, it adds absolute path instead every time I execute next lint.

  6. KubaJastrz commented on Mar 22, 2023

    @KubaJastrz

    Yeah, it's somewhat annoying, especially when my codebase is in an external volume/drive, it adds absolute path instead every time I execute next lint.

    Same thing happens in WSL2 environment.

  7. locked and limited conversation to collaborators on Apr 30, 2024
  8. converted this issue into a discussion #65208 on Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    TypeScriptRelated to types with Next.js.bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions