An import path cannot end with a '.ts' extension
See original GitHub issueHey! First of all, thanks for a great library 😃
I was just working on getting this set up in my project, and I get an error when I try to import the library in a typescript file:
import * as Factory from 'factory.ts';
The compiler says:
error TS2691: An import path cannot end with a '.ts' extension. Consider importing 'factory' instead.
I am using Typescript 2.4.2 and library version 0.2.2.
Is there something I am missing in the tsconfig? How can I get past this error? Thanks!
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:13 (4 by maintainers)
Top Results From Across the Web
An import path cannot end with '.ts' - NodeJS and Visual Code
Even that Visual Code prompts an error, my code got running.. When I remove the .ts extension from import statement, I got an...
Read more >Suppressing "The import path cannot end with a '.ts' extension ...
So the output a.js will contain the same import specifier "./b.ts", although possibly translated to require("./b.ts")Â ...
Read more >An import path cannot end with a '.ts' extension. : r/Deno - Reddit
An import path cannot end with a '.ts' extension. · Install the Deno CLI. · Install this extension. · Ensure deno is available...
Read more >Importing a `.ts` file from a rollup-bundled `.ts` file?
Summary CodeMirror.ts is being bundled by rollup and built by yarn watch ... error TS2691: An import path cannot end with a '.ts'...
Read more >An import path cannot end with a '.ts' extension ... - Issuehunt
An import path cannot end with a '.ts ' extension. Consider importing 'xx.js' instead. #2750. cn3lfs posted onGitHub. <!-- Check those before opening...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I see that this is closed - any resolution on this ? Unfortunately @MoSattler’s solution doesn’t work for me 😦
If this causes problems with
npm ci, another option is to use