microsoft / microsoft/TypeScript

Project reference build error when one of projects' exported var contains external module's vars.

Open
#42,733 0 comments 2 reactions 1 assignee View on GitHub

@weswigham is already working on this.

Since Feb 12, 2021.

Bug Domain: tsc -b Rescheduled
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

Bug Report

🔎 Search Terms

Project Reference.

🕗 Version & Regression Information
  • This is a crash
  • This changed between versions ______ and _______
  • This is the behavior in every version I tried, and I reviewed the FAQ for entries about ProjectReference
  • I was unable to test this on prior versions because _______
⏯ Playground Link

https://github.com/07akioni/project-reference-build-error

💻 Code
// proj1/index.ts
import { enUS } from 'date-fns/locale'

const myLocale = {
  name: 'enUS',
  locale: enUS
}

export {
  myLocale
}
// proj2/index.ts
import { myLocale } from 'proj1'

console.log(myLocale)
🙁 Actual behavior
error TS2304: Cannot find name 'Locale'
🙂 Expected behavior

It works.

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.