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

TS 3.0-rc project references to ancestor folders breaks module dependency ordering. #26054

Closed
WearyMonkey opened this issue Jul 30, 2018 · 1 comment
Assignees
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue

Comments

@WearyMonkey
Copy link

When a project contains a reference to project in a ancestor folder, includes source files must be listed in dependency order.

TypeScript Version: 3.0-rc, 3.0.1-insiders.20180726, and 3.1.0-dev

Search Terms:

3.0 project references

Code

{
  "compilerOptions": {
    "composite": true,
    "declaration": true

  },
  "references": [
    { "path": ".." }
  ],
  "files": [
    "./imports.ts",
    "./exports.ts"
  ]
}

Where imports.ts is:

import { foo } from './exports';

and exports.ts is:

export const foo = 'foo';

Expected behavior:

Compilation succeeds.

Actual behavior:

error TS6305: Output file '/Users/toby/dev/ts3_bug/proj1/proj2/exports.d.ts' has not been built from source file '/Users/toby/dev/ts3_bug/proj1/proj2/exports.ts'.

Changing the order of files to:

  "files": [
    "./exports.ts",
    "./imports.ts"
  ]

Succeeds.

Github project Link:

https://github.com/WearyMonkey/ts3-file-order-bug

Related Issues:

#25600 (comment)

@mhegazy mhegazy added the Bug A bug in TypeScript label Jul 30, 2018
@mhegazy mhegazy added this to the TypeScript 3.1 milestone Jul 30, 2018
@tommedema
Copy link

This seems crucial. Reading https://blogs.msdn.microsoft.com/typescript/2018/07/30/announcing-typescript-3-0/#project-references it says the the main purpose of references is build ordering; which actually appears to be broken? This issue was reported 1 month ago but supposedly with no progress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript Fixed A PR has been merged for this issue
Projects
None yet
Development

No branches or pull requests

5 participants