NearSocial / VM

Near Social VM
The Unlicense
36 stars 58 forks source link

VM.require method drops "Cannot read properties of undefined (reading 'rawCode')" error #137

Closed matiasberaldo closed 11 months ago

matiasberaldo commented 11 months ago

Problem

There's an issue with the VM.require method which drops the following error:

image

The components loaded using the VM.require method are stateless, and the parent component doesn't pass any state property to the components loaded by VM.require.

Steps to reproduce

There are different ways to reproduce this issue, even with common gateways such as Near.org, Near.Social and Jutsu.ai, but the following one is the easiest way to reproduce it:

  1. Fork or use the following bOS components:
  1. Fork the Polygon Gateway: https://github.com/NearDeFi/polygon-bos-gateway
  2. Replace the VM component link under src/components/polygon/index.tsx to the Stateful Main Component forked or use the same as step 1 (mattb.near/widget/Linktree.Main).
  3. Deploy the gateway using Vercel
  4. The gateway drops the error: Cannot read properties of undefined (reading 'rawCode')

Live example

You can check a live example of the error in the following link.

evgenykuzyakov commented 11 months ago

Please update the VM dependency from near-social-vm": "github:NearSocial/VM#2.2.3" to near-social-vm": "github:NearSocial/VM#2.4.2"

matiasberaldo commented 11 months ago

Hello @evgenykuzyakov

Yes, looks like updating to the latest version (2.4.2) the issue has been solved.

Thank you so much for your support and time