You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to initialize a project using @cardano-sdk/core and node fails
Steps to reproduce the bug
Initialize a new npm package with npm & nodejs v18.18.2
set type:module in package.json
Add @cardano-sdk/core to the dependencies
enter node repl and import it
Actual Result
[nix-shell:~/c/cjssdk-test]$ node --experimental-specifier-resolution=node
(node:2382229) ExperimentalWarning: The Node.js specifier resolution flag is experimental. It could change or be removed at any time.
(Use `node --trace-warnings ...` to show where the warning was created)
Welcome to Node.js v18.18.2.
Type ".help" for more information.
> const c = await import('@cardano-sdk/core')
Uncaught:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'rxjs' imported from /home/me/c/cjssdk-test/node_modules/@cardano-sdk/core/dist/esm/CardanoNode/util/bufferChainSyncEvent.js
at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
at new NodeError (node:internal/errors:405:5)
at packageResolve (node:internal/modules/esm/resolve:890:9)
at moduleResolve (node:internal/modules/esm/resolve:939:20)
at defaultResolve (node:internal/modules/esm/resolve:1132:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:835:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18) {
code: 'ERR_MODULE_NOT_FOUND'
}
>
Expected Result
Importing works
SDK version
0.21.0
Environment type
Node.js
Browser
Browser Extension
Other
Environment details
nodejs v18.18.2
The text was updated successfully, but these errors were encountered:
core package was supposed to only import types from rxjs in order to define ObservableCardanoNode interface, but clearly it's no longer the case. We should probably hoist bufferChainSyncEvent to projection package.
Summary
I'm trying to initialize a project using
@cardano-sdk/core
and node failsSteps to reproduce the bug
type:module
inpackage.json
@cardano-sdk/core
to the dependenciesActual Result
Expected Result
Importing works
SDK version
0.21.0
Environment type
Environment details
nodejs v18.18.2
The text was updated successfully, but these errors were encountered: