Skip to content

Module AMD and outFile causes declaration emit to use module that does not exist #37267

@AnyhowStep

Description

@AnyhowStep

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
  1. You should now see a test-amd.d.ts file.
  2. Open test-amd.d.ts with VS code or something.
  3. Set VS code to use the TypeScript version in node_modules (3.5.1)
  4. Ctrl+F > const concat:

You will see this,
image

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs InvestigationThis issue needs a team member to investigate its status.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions