Closed AgustinRamiroDiaz closed 4 days ago
Just tried the import itself here with 0.3.3 and it seems to work fine.
Could you be having this problem however:
client = createClient({
chain: simulator, // !! This key is named 'network' in the docs, but it has to be 'chain'
// account
});
}
@denishacquin
az@canela ~/y/A/deploy-on-genlayer (main) [1]> npm list
deploy-on-genlayer@ /home/az/yeagerai/AYBABTU/deploy-on-genlayer
├── @types/node@22.9.0
├── genlayer-js@0.3.3
├── ts-node@10.9.2
└── typescript@5.6.3
az@canela ~/y/A/deploy-on-genlayer (main)> npm start
> start
> ts-node database.update.ts
/home/az/yeagerai/AYBABTU/deploy-on-genlayer/node_modules/ts-node/src/index.ts:859
return new TSError(diagnosticText, diagnosticCodes, diagnostics);
^
TSError: ⨯ Unable to compile TypeScript:
database.update.ts:3:27 - error TS2307: Cannot find module 'genlayer-js/chains' or its corresponding type declarations.
3 import { simulator } from "genlayer-js/chains";
~~~~~~~~~~~~~~~~~~~~
now that I see it, maybe it's a problem with my tsconfig
Sorry for the noise, it was actually a problem with my tsconfig.json
This is what has worked for me
// tsconfig.json
{
"compilerOptions": {
"module": "esnext",
"moduleResolution": "bundler"
}
}
plus using `tsx` to run the typescript script
I'm using version 0.3.3
I cannot use the import from the docs
I have to use
which is not the expected import (as per the npm docs)