Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: fetch api not working when Embed App in React #1042

Closed
@Just1nWang

Description

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When I integrated the application into the react project using lowcoder-sdk, the fetch called in run javascript had no effect.

Expected Behavior

When I integrated the application into the react project using lowcoder-sdk, the fetch called in run javascript can work.

Steps to reproduce

  1. Add a FormButton
  2. Listen Click Event
  3. Write Javascript as Follow
async function fetch_ip() {
 console.log("1. fetch start")
 try {
 const res = await fetch("https://api.ipify.org?format=json")
 console.log("2. fetch end")
 if (!res.ok) {
 console.log("3. fetch error")
 } else {
 console.log("4. fetch ok")
 const result = await res.json()
 return result
 }
 } catch (error) {
 console.log("5. fetch exception", error)
 }
}
fetch_ip().then(res => {
 console.log("6. fetch result", res)
})
  1. Embed App in React using lowcoder-sdk
  2. click FormButton in React app
  3. check Chrome DevTools Network, no any request send.

Environment

"lowcoder": 2.4.2
"lowcoder-sdk": "^2.4.8"

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /