adrianhajdin / project_crowdfunding

With a stunning design, connected to the blockchain, metamask pairing, interaction with smart contracts, sending Ethereum through the blockchain network, and writing solidity code.
https://jsmastery.pro
680 stars 372 forks source link

contract call failure TypeError: Cannot read properties of undefined (reading 'length') #71

Closed sandipmaurya2611 closed 2 months ago

sandipmaurya2611 commented 10 months ago

I get a contract call Failure TypeError :- mutation.ts:261 TypeError: Cannot read properties of undefined (reading 'length') at toUtf8Bytes (utf8.ts:210:29) at StringCoder.encode (string.ts:19:37) at array.ts:62:19 at Array.forEach () at pack (array.ts:54:12) at TupleCoder.encode (tuple.ts:54:16) at AbiCoder.encode (abi-coder.ts:111:15) at Interface._encodeParams (interface.ts:323:31) at Interface.encodeFunctionData (interface.ts:378:18) at ContractWrapper.formatError (contract-publisher-6a419060.browser.esm.js:8668:46) execute @ mutation.ts:261 await in execute (async) mutate @ mutationObserver.ts:136 publishCampaign @ index.jsx:14 (anonymous) @ CreateCampaign.jsx:33 img.onload @ index.js:20 load (async) checkIfImage @ index.js:20 handleSubmit @ CreateCampaign.jsx:30 callCallback2 @ react-dom.development.js:4164 invokeGuardedCallbackDev @ react-dom.development.js:4213 invokeGuardedCallback @ react-dom.development.js:4277 invokeGuardedCallbackAndCatchFirstError @ react-dom.development.js:4291 executeDispatch @ react-dom.development.js:9041 processDispatchQueueItemsInOrder @ react-dom.development.js:9073 processDispatchQueue @ react-dom.development.js:9086 dispatchEventsForPlugins @ react-dom.development.js:9097 (anonymous) @ react-dom.development.js:9288 batchedUpdates$1 @ react-dom.development.js:26140 batchedUpdates @ react-dom.development.js:3991 dispatchEventForPluginEventSystem @ react-dom.development.js:9287 dispatchEventWithEnableCapturePhaseSelectiveHydrationWithoutDiscreteEventReplay @ react-dom.development.js:6465 dispatchEvent @ react-dom.development.js:6457 dispatchDiscreteEvent @ react-dom.development.js:6430

Error

index.jsx:27 contract call failure TypeError: Cannot read properties of undefined (reading 'length') at toUtf8Bytes (utf8.ts:210:29) at StringCoder.encode (string.ts:19:37) at array.ts:62:19 at Array.forEach () at pack (array.ts:54:12) at TupleCoder.encode (tuple.ts:54:16) at AbiCoder.encode (abi-coder.ts:111:15) at Interface._encodeParams (interface.ts:323:31) at Interface.encodeFunctionData (interface.ts:378:18) at ContractWrapper.formatError (contract-publisher-6a419060.browser.esm.js:8668:46)

Please Give Me Solution

ign-ace commented 10 months ago

Complete the length() function.....you must have missed the () cause in video he misses it