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

Bug: When running it in conjunction with framegear an error occurs when handling the submit from "Story time" action #17

Open
claudioantonio opened this issue Jun 13, 2024 · 1 comment · May be fixed by #18

Comments

@claudioantonio
Copy link

claudioantonio commented Jun 13, 2024

Steps to reproduce

  1. clone this repo
  2. npm install
  3. npm run dev to run a-frame-in-100-lines app
  4. clone onchainkit repo
  5. cd /framegear
  6. npm install
  7. npm run dev
  8. get url provided in 3 and paste it into the input field on framegear website and then press Fetch button
  9. the frame will be presented on framegear website
  10. enter any text in the input field of the frame being rendered and then press "Story time"
  11. you will see an error on the backend of a-frame-in-100-lines app

The error message

FetchError: non-200 status returned from neynar : 400
    at Object.postDataToNeynar (webpack-internal:///(rsc)/./node_modules/@coinbase/onchainkit/lib/utils/neynar/postDataToNeynar.js:18:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async Object.neynarFrameValidation (webpack-internal:///(rsc)/./node_modules/@coinbase/onchainkit/lib/utils/neynar/frame/neynarFrameValidation.js:7:26)
    at async getFrameMessage (webpack-internal:///(rsc)/./node_modules/@coinbase/onchainkit/lib/frame/getFrameMessage.js:20:22)
    at async getResponse (webpack-internal:///(rsc)/./app/api/frame/route.ts:14:34)
    at async /home/claudio/src/cartesi/a-frame-in-100-lines/node_modules/next/dist/compiled/next-server/app-route.runtime.dev.js:6:62499

Extra comments

This repo is using onchainkit library 0.14.1 and the framegear app on onchainkit's repo is using onchainkit library version 0.15.0.
I updated this repo to version 0.15.0, but the error is the same.

@claudioantonio claudioantonio changed the title Bug: When running it in conjunction with framegear and error occurs when handling the submit from "Story time" action Bug: When running it in conjunction with framegear an error occurs when handling the submit from "Story time" action Jun 13, 2024
@claudioantonio
Copy link
Author

Reading onchainkit docs, I found the solution:

When using the getFrameMessage function, include the allowFramegear option to enable Framegear to send mock frame actions.
After adding the allowFramegear option it worked as expected.

But the docs suggest a protection:

import { getFrameMessage } from '@coinbase/onchainkit/frame';
const allowFramegear = process.env.NODE_ENV !== 'production'; 
// ...
const { isValid, message } = await getFrameMessage(body, {
  allowFramegear, 
});

@claudioantonio claudioantonio linked a pull request Jun 14, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant