microsoft / microsoft/TypeScript

project reference { "path": "" } is ignored

Open
#63,848 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Bug
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Steps to reproduce

In every project folder I have a ./tsconfig.build.json which my build script finds and compiles.
In one project I have no subdirectories but only flat files, so I reference "the same directory".

./tsconfig.build.json

{
    "$schema": "http://json.schemastore.org/tsconfig",
    "references": [
        { "path": "" }
    ],
    "files": [],
    "include": []
}

The file ./tsconfig.json contains the final compile:

{
    "$schema": "http://json.schemastore.org/tsconfig",
    "extends": "../tsconfig_base",
    "include": ["./*.ts"]
}

Looks silly, but I also have ./tsconfig.build.json which have this:

    "references": [
        { "path": "Worker/" },
        { "path": "" },

Behavior with typescript@6.0

Compiles

> node_modules\.bin\tsc --build Folder/tsconfig.build.json --force --verbose
[17:36:53] Projects in this build:
    * Folder/tsconfig.json
    * Folder/tsconfig.build.json
...

Behavior with tsgo

> node_modules\.bin\tsgo --build Folder/tsconfig.build.json --force --verbose
[05:37:22 PM] Projects in this build:
    * Folder/tsconfig.build.json
...

When I change the file ./tsconfig.build.json to that:

{
    "$schema": "http://json.schemastore.org/tsconfig",
    "references": [
        { "path": "./" }
    ],
    "files": [],
    "include": []
}

It compiles like a charm, but still I wanted to report the compiler difference.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the difference with the shown tsconfig.build.json and the tsc --build and tsgo --build commands, comparing their verbose project lists. Trace how each command resolves the references path values "" and "./"; done means an empty path is handled consistently with the current-directory path.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, typescript
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
62/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.