-
Notifications
You must be signed in to change notification settings - Fork 8
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
ES6 import error #2
Comments
Rename ChangeCalculator to ChangeCalculator.js
Create lower to upper.cpp
Sorry I missed this earlier! Checking it this week. Weird as I have it working; might be due to my tsconfig settings. Do you know if |
I'm running into the same issue. When I try
|
@jcowman2 @miso440 Do you have a link to any project that causes this error when attempting to import Prando? The reason I'm asking is because I've been unable to replicate it; my own projects that use the package still work with the latest version. I'm thinking this is somehow related to the tsconfig settings, but haven't been able to pinpoint what yet. |
@zeh Thanks for looking into this. Here's the branch of my project that's failing. To replicate, clone + install dependencies, then run |
@jcowman2 Thanks man, I'm taking a look. |
Identified the issue, more or less. It's when using TSC directly or, in your case, ts-node. They try resolving to the I haven't noticed that before because my standard builds use Webpack or similar packagers, and it works fine there. Apologies. Still investigating, as it's likely we just need to export the UMD file in a way that is better understood by tsc. Edit: more investigation: UMD modules with defaults are not properly imported by TypeScript because of this error. Compiling with |
@jcowman2 I think I've fixed it. It was missing a synthetic export. I managed to fix in another library of mine with a hack but somehow never realized it was missing in this library. Anyway, I've published a new release. It shouldn't be breaking anything (old exports are still the same), but since this is somewhat of a big impact change, it's a new major version: 5.0.0. Trying your repo with npm install prando@latest --save
npm run test Works well with the tests you had that were previously broken. Can you try again? |
I've just confirmed, it works in my project now. Thanks so much for the help, @zeh ! 🎉 |
Nice! Thank you for the report and the repro! |
Closed as this is fixed in v5.0.0. |
A TS file such as:
Compiled to JS and ran throws:
Doing the
require
method allows construction of aPrando
object but breaks all the typing.Same result in Node versions
8.9.2
and10.12.0
The text was updated successfully, but these errors were encountered: