Skip to content

Reflect-metadata broken in 1.6.2: TS2306: File 'node_modules/reflect-metadata/reflect-metadata.d.ts' is not a module. #4877

Closed
@mattyork

Description

@mattyork

To reproduce:

  1. Update to Typescript v1.6.2 and reflect-metadata v0.1.1
  2. Compile this:
/// <reference path="node_modules/reflect-metadata/reflect-metadata.d.ts" />
import 'reflect-metadata';

Expected: compiles just fine
Actual: compile error:

index.ts(3,8): error TS2306: File 'node_modules/reflect-metadata/reflect-metadata.d.ts' is not a module.

I created a git repo to demonstrate:

git clone https://github.com/mattyork/TypescriptReflectMetadataBug.git
cd TypescriptReflectMetadataBug
npm install
./node_modules/.bin/tsc

If I delete the typings field in package.json this error goes away. What is this typings field for and why is it causing this bug?

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptFixedA PR has been merged for this issueHigh Priority

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions