Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package name issue #20

Closed
mnn opened this issue Oct 26, 2018 · 5 comments
Closed

Package name issue #20

mnn opened this issue Oct 26, 2018 · 5 comments

Comments

@mnn
Copy link

mnn commented Oct 26, 2018

I am trying your library:

import { Vector } from 'prelude.ts';

But I got this error:

src/index.ts:5:24 - error TS2691: An import path cannot end with a '.ts' extension. Consider importing 'prelude' instead.

So I tried only prelude as it suggests and that crashes with this:

src/index.ts:5:24 - error TS2307: Cannot find module 'prelude'.

When I was installing the package I thought the name is a bit weird, but I didn't expect it is not supported by TypeScript.

TS: 3.1.3
prelude.ts: 0.8.1

@mnn
Copy link
Author

mnn commented Oct 26, 2018

Found #18 (comment) and the advice in the link works. I still think the name choice is very poor, if it is not supported by TS by default. I almost abandoned trying this library because of this...

@emmanueltouzery
Copy link
Owner

i don't understand, what is the advice that works? I would assume that if you got the error An import path cannot end with a '.ts' extension that would mean that you didn't run npm install after adding prelude to your dependencies?

What is it that you did to fix it in the end? I didn't expect it to be a hurdle honestly, I'm interested in what was the fix for you.

@emmanueltouzery
Copy link
Owner

ah the issue would be the module system being es2015. certainly I can add a FAQ entry for that. Maybe I'll consider again renaming.

@mnn
Copy link
Author

mnn commented Oct 26, 2018

Adding "moduleResolution": "node" to tsconfig.json. Other libraries were working without that option.

@mnn
Copy link
Author

mnn commented Oct 26, 2018

Yes, please at least make a note in FAQ or installation, so others aren't as confused as I was :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants