microsoft / microsoft/TypeScript
Module AMD and outFile causes declaration emit to use module that does not exist
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
TypeScript Version: 3.5.1, 3.7.5, 3.8.3
Search Terms: module, amd, outFile, declaration emit
Code
git clone https://github.com/AnyhowStep/tsql.git
cd tsql
git checkout e5a0d16ac31d868f03386b4381e51eed5f6c731d
npm install
./node_modules/.bin/tsc -m amd --outFile test-amd.js
- You should now see a
test-amd.d.tsfile. - Open
test-amd.d.tswith VS code or something. - Set VS code to use the TypeScript version in
node_modules(3.5.1) - Ctrl+F >
const concat:
You will see this,

Cannot find module 'expr-library/factory'.ts(2307)
That module, indeed, does not exist.
In fact, it is looking for import("expr-library/factory/make-operator-1-to-n").Operator1ToN but is looking at the wrong module.
There are many other places where it references "expr-library/factory", which does not exist.
Expected behavior:
emitted .d.ts should either use import("expr-library/factory/make-operator-1-to-n").Operator1ToN or emit a "expr-library/factory" module
Actual behavior:
Emit uses "expr-library/factory", it does not exist
Playground Link: None
Related Issues: None
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Clone the tsql repository at commit e5a0d16ac31d868f03386b4381e51eed5f6c731d, install dependencies, and run the provided tsc command with AMD and outFile. Inspect test-amd.d.ts around the concat declaration and its expr-library/factory references. Done means declaration emit references the existing make-operator-1-to-n module or emits a matching expr-library/factory module without unresolved-module errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 38/100