I installed version 1.3.1 and was unable to import and use it. It seems that the imports in the es6 source in the dist do not end with .js. I forked the repo and packed myself, and the imports were correct in the tarball that was generated on my machien.
If you unpack it, you'll see that the imports in the *.d.ts files for es6 are like:
import { Options as ParserOptions } from './parser/index';
When it seems they should be like:
import { Options as ParserOptions } from './parser/index.js';
Received this error (and many more) when attempting to build my code:
node_modules/comment-parser/es6/index.d.ts:1:42 - error TS2835: Relative import paths need explicit file extensions in EcmaScript imports when '--moduleResolution' is 'node16' or 'nodenext'. Did you mean './parser/index.js'?
1 import { Options as ParserOptions } from './parser/index';
fwiw: a workaround is to make sure "skipLibCheck": true is set. I also threw a pr out there to bump ts and use node16module[Resolution] if that's desired.
I installed version
1.3.1
and was unable toimport
and use it. It seems that the imports in the es6 source in the dist do not end with.js
. I forked the repo and packed myself, and the imports were correct in the tarball that was generated on my machien.Attached is the tarball obtained from npm. comment-parser-1.3.1.tgz
If you unpack it, you'll see that the imports in the
*.d.ts
files for es6 are like:When it seems they should be like:
Received this error (and many more) when attempting to build my code: