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

TypeError: (0 , S.default) is not a function #2

Open
Nizarius opened this issue Jul 7, 2024 · 1 comment
Open

TypeError: (0 , S.default) is not a function #2

Nizarius opened this issue Jul 7, 2024 · 1 comment

Comments

@Nizarius
Copy link

Nizarius commented Jul 7, 2024

I receive this stack trace when trying to invoke createPublicClient in nodejs environment:

TypeError: (0 , S.default) is not a function
    at G (/Users/petrpotapov/Projects/lottery-smart-func/smart-func/node_modules/@fotonjs/api/dist/index.cjs:1:2864)
    at $ (/Users/petrpotapov/Projects/lottery-smart-func/smart-func/node_modules/@fotonjs/core/dist/index.cjs:1:1207)
    at Object.<anonymous> (/Users/petrpotapov/Projects/lottery-smart-func/smart-func/scripts/getLotteryResults.ts:16:47)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module.m._compile (/Users/petrpotapov/Projects/lottery-smart-func/smart-func/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/petrpotapov/Projects/lottery-smart-func/smart-func/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Function.Module._load (node:internal/modules/cjs/loader:1022:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)

Environment:
"@fotonjs/core": "^0.0.7",
"@ton/core": "^0.56.3",

TS config (tested in different environments, didn't help):
{
"compilerOptions": {
"target": "ES2020",
"outDir": "dist",
"module": "commonjs",
"declaration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true,
"skipLibCheck": true
}
}

My current ideation process is that this library is designed to be used in browser environment with nodejs polyfills and isn't designed to be used on the backend. Is that correct assumption?

@VanishMax
Copy link
Owner

@Nizarius Thanks for the issue. Foton wasn't tested within node environment yet, but the idea is that it should work as expected in both Node and Browser. Only createWalletClientUI is designed to be browser-only

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