TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Import statement with path relative to project root is not working with tsc 1.6.2. Worked fine in 1.5.3.

Open firecube opened this issue 11 years ago • 2 comments

Hi,

With tsc 1.5.3 my app compiled fine with import statements using paths relative to the project root.

e.g.

.vscode +src tsconfig.json +app app.ts +helpers maths.ts

In app.ts this import statement worked fine... import {Maths} from 'src/helpers/maths';

It does not work on 1.6.2 and neither does... import {Maths} from 'helpers/maths';

The only way I can get it to work is with a relative path... import {Maths} from '../helpers/maths';

Could this be related to the the node_modules import changes?

Am I doing this wrong? Should all paths be relative?

Thanks, Simon

firecube avatar Oct 08 '15 15:10 firecube

Do you use CommonJS as target module kind? If yes, then it is a breaking change that we have in 1.6, you can find more details here.

vladima avatar Oct 08 '15 16:10 vladima

That was it... thank you!

firecube avatar Oct 09 '15 09:10 firecube