Closed steliosrammos closed 11 months ago
@steliosrammos it failed for me too building alby-js-sdk. What typescript version are you using? updating to the lastest (^5.1.6) now compiles.
Note: for me most versions worked fine (nostr-tools v1.10.0 - 1.13.0 built successfully but 1.13.1 failed)
https://github.com/nbd-wtf/nostr-tools/compare/v1.13.0...v1.13.1 is only dependency changes, so I am not sure why it started happening here.
Everybody should stop using JavaScript.
I've poked around at the .d.ts
files that the published package has, and noticed two issues.
.ts
extension on import (e.g. export * from './relay.ts'
)
allowImportingTsExtensions
seems to note that it now requires your bundler to know how to deal with these imports, so I suspect this is more problematic than initially expectedimport { Something, type SomethingElse } from '...'
Which is not something I could find any documentation around. However I'm familiar with
import type { Something, SomethingElse } from '...`
which you can only use if all imports are type-only.
I'd be happy to put up a PR with some fixes to these, but would also ask @alexgleason to weigh in and make sure it doesn't break anything for Deno users to revert the allowImportingTsExtensions
change.
@steliosrammos were you able to get this resolved? I am running into this as well, but only for the typescript files in my project (javascript files import fine) and only for direct exports like matchFilter or simplePool (all the nipXX import fine still)
@monlovesmango you just need to update to latest typescript, that should fix it.
thanks @wbobeirne! that did it
Upgrading to v1.11 or higher results in a build time error when importing from nostr-tools.
Example:
Results in:
The same happens with other imports from nostr-tools too.
Possibly related to: https://github.com/nbd-wtf/nostr-tools/commit/9f896479d0758886278af91f82afe649bce4401f