Skip to content

import statement broken from migration 1.0.3 to 1.1 or higher #954

Closed
@epinxteren

Description

@epinxteren

I have searched the github project for any release changes bud my import statements are broken from a code migration of 1.0.3 to version 1.1 or higher. (http://stackoverflow.com/questions/26543594/import-statement-broken-from-migration-1-0-3-to-1-1-or-higher)

Directory structure:

  • BatteryIncluded/TextWriter.ts
  • BatteryIncluded/Registry.ts

Code Registry.ts:

import TextWriter = require("BatteryIncluded/TextWriter");

class Registry <ValueType> {
   // etc...
}

export = Registry;

Code TextWriter.ts:

class TextWriter {
   // etc..
}

export = TextWriter;

In typescript version 1.0.3 the error would not occur. But in version 1.1 or higher the error is:

"C:/Program Files/nodejs/node.exe" C:\PROJECT_GIT\TypeScript\built\local\tsc.js --sourcemap --    target ES5 --module AMD Registry.ts
Registry.ts(2,29): error TS2307: Cannot find external module 'BatteryIncluded/TextWriter'.

Using typescript in the form of:

node C:\PROJECT_GIT\TypeScript\built\local\tsc.js --sourcemap --target ES5 --module AMD

To fix this problem i can use the import statement:

import TextWriter = require("./TextWriter");

This is not desired because all deeply nested files i need to do something like this:

import TextWriter = require("../../../TextWriter");

Before could just use:

import TextWriter = require("BatteryIncluded/TextWriter");

I have searched on TypeScript GitHub repro for release changes that could imply this error, but couldn't find any.

Metadata

Metadata

Assignees

Labels

BugA bug in TypeScriptWon't FixThe severity and priority of this issue do not warrant the time or complexity needed to fix it

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions