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

Cannot create proposal through snapshot api: Failed to create proposal: TypeError: value is undefined #1104

Open
Tiimie1 opened this issue Dec 18, 2024 · 0 comments

Comments

@Tiimie1
Copy link

Tiimie1 commented Dec 18, 2024

Expected behavior

Open wallet dialog to confirm the creation of proposal

Actual behavior

Useless error:

Failed to create proposal: TypeError: value is undefined
    _visit webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/hash/lib.esm/typed-data.js:314
    _visit webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/hash/lib.esm/typed-data.js:320
    _visit webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/hash/lib.esm/typed-data.js:319
    visit webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/hash/lib.esm/typed-data.js:327
    resolveNames webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/hash/lib.esm/typed-data.js:376
    __awaiter webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/hash/lib.esm/typed-data.js:19
    __awaiter webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/hash/lib.esm/typed-data.js:15
    resolveNames webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/hash/lib.esm/typed-data.js:364
    _signTypedData webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js:330
    __awaiter webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js:24
    __awaiter webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js:20
    _signTypedData webpack-internal:///(app-pages-browser)/./node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js:328
    sign webpack-internal:///(app-pages-browser)/./node_modules/@snapshot-labs/snapshot.js/dist/snapshot.min.js:16
    e webpack-internal:///(app-pages-browser)/./node_modules/@snapshot-labs/snapshot.js/dist/snapshot.min.js:16
    e webpack-internal:///(app-pages-browser)/./node_modules/@snapshot-labs/snapshot.js/dist/snapshot.min.js:16
    sign webpack-internal:///(app-pages-browser)/./node_modules/@snapshot-labs/snapshot.js/dist/snapshot.min.js:16
    proposal webpack-internal:///(app-pages-browser)/./node_modules/@snapshot-labs/snapshot.js/dist/snapshot.min.js:16
    e webpack-internal:///(app-pages-browser)/./node_modules/@snapshot-labs/snapshot.js/dist/snapshot.min.js:16
    e webpack-internal:///(app-pages-browser)/./node_modules/@snapshot-labs/snapshot.js/dist/snapshot.min.js:16
    proposal webpack-internal:///(app-pages-browser)/./node_modules/@snapshot-labs/snapshot.js/dist/snapshot.min.js:16
    createProposal webpack-internal:///(app-pages-browser)/./src/app/[locale]/components/Admin/Governance/useProposalsHook.tsx:48
    buttonAction webpack-internal:///(app-pages-browser)/./src/app/[locale]/components/Admin/Governance.tsx:84
    handleSubmit webpack-internal:///(app-pages-browser)/./src/app/[locale]/components/Admin/ProposalForm.tsx:39
    React 21
    hydrateRoot webpack-internal:///(app-pages-browser)/./node_modules/next/dist/compiled/react-dom/client.js:17
    hydrate webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:231
    startTransition React
    hydrate webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-index.js:231
    <anonymous> webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-next-dev.js:10
    appBootstrap webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-bootstrap.js:57
    loadScriptsInSequence webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-bootstrap.js:23
    appBootstrap webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-bootstrap.js:56
    <anonymous> webpack-internal:///(app-pages-browser)/./node_modules/next/dist/client/app-next-dev.js:7

Steps to reproduce the behavior

snapshot version "@snapshot-labs/snapshot.js": "^0.12.39",


const web3 = new Web3Provider(window.ethereum!)
const [account] = await web3.listAccounts()
#filled with some demo data
await client.proposal(web3, userContext.walletAddress as string, {
        space: snapshotsConfig.spaceId,
        type: 'single-choice',
        title: title,
        body: body,
        discussion: 'https://engage.defactor.dev',
        choices: ['yes', 'no'],
        start: Math.round(new Date().getTime() / 1000),
        end: Math.round(new Date().getTime() / 1000) + 259200,
        snapshot: blockNum,
        plugins: JSON.stringify({})
})
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

1 participant