Giter Club home page Giter Club logo

tsc-ref-bug's Introduction

tsc --build repo2

repo1/dist/a.d.ts(1,19): error TS2307: Cannot find module 'b' or its corresponding type declarations.

tsc --build repo1

success

Type declaration imports are not resolved correctly. They are resolved from the rules in repo2/tsconfig.json.

This means that if we create repo2/b.ts with this content:

import {T} from 'repo1';

export type {T};

This is the content for repo3.

tsc --build repo3

repo3/b.ts(1,9): error TS2303: Circular definition of import alias 'T'.

since repo1/a.d.ts imports 'b' (resolves to repo3/b.ts) -> imports repo1/a.d.ts -> ...

repo1/a.d.ts importing 'b' should resolve to repo1/b.d.ts and not repo3/b.ts

To show that this is an issue with d.ts file importing and no path/references, repo4 has no tsconfig and has a copy of repo1 inside its node_modules.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.