Skip to content

import not working the same with ts-node and tsc + node #786

Description

@bjg2

ts-node version v8.0.2
tsc version 3.3.3

Please take a look at ts-node-fail repo, there is a small repro.

If I execute

ts-node test.ts

while there are no transpiled js files (so there's no config.js) config.ts import is messed up and I get output:

hi from test!

If I execute

tsc test.ts
node test.js

import works as expected and I get full output

hi from config!
hi from test!

Am I using something wrong? Seems like ts-node just has the bad execution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions