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

页面schema模板中dataSource配置好后,运行低代码引擎进行渲染,出现如下报错信息:Error: the getUserInfo request should not fetch, please check the condition。麻烦帮看下是什么原因导致没发出请求 #2856

Open
yunnode opened this issue Jan 16, 2024 · 7 comments
Assignees
Labels
insufficient information Further information is requested / 信息不足,请补充信息

Comments

@yunnode
Copy link

yunnode commented Jan 16, 2024

Describe the bug (required) / 详细描述 bug(必填)

我dataSource配置好后,运行低代码引擎进行渲染,出现如下报错信息:Error: the getUserInfo request should not fetch, please check the condition。请帮排查下该问题,谢谢。

A clear and concise description of what the bug is. / 请提供清晰且精确的 bug 描述
以下是dataSource配置:

"dataSource": {
    "list": [
      {
        "type": "fetch",
        "isInit": true,
        "options": {
          "params": {},
          "method": "GET",
          "isCors": true,
          "timeout": 5000,
          "headers": {},
          "uri": "/mock/info.json"
        },
        "id": "info",
        "shouldFetch": {
          "type": "JSFunction",
          "value": "function() { \n  console.log('should fetch.....');\n  return true; \n}"
        }
      },
      {
        "type": "fetch",
        "isInit": true,
        "options": {
          "params": {},
          "method": "GET",
          "isCors": true,
          "timeout": 500000,
          "headers": {},
          "uri": "/aaa/bbb/getUser"
        },
        "id": "getUserInfo",
        "shouldFetch": {
          "type": "JSFunction",
          "value": "function updateUserInfo(res) { \n console.log('should fetch 2 ...'); \n console.log('getUserInfo res:', res); \nthis.setState({\n      stageData: res.data\n    });\n \nreturn res.data\n}"
        }
      }
    ]
}

我运行页面(加载低代码引擎渲染后),浏览器控制台出现如下报错信息:Error: the getUserInfo request should not fetch, please check the condition 。
详细报错信息如下:

 Error: the getUserInfo request should not fetch, please check the condition
    at RuntimeDataSourceItem.<anonymous> (src_apps_mobile_pages_create-special-customer_lowcode-page_tsx.chunk.js:4242:29)
    at step (main.bundle.js:108906:17)
    at Object.next (main.bundle.js:108855:14)
    at main.bundle.js:108829:67
    at new Promise (<anonymous>)
    at Module.__awaiter (main.bundle.js:108811:10)
    at RuntimeDataSourceItem.load (src_apps_mobile_pages_create-special-customer_lowcode-page_tsx.chunk.js:4195:20)
    at src_apps_mobile_pages_create-special-customer_lowcode-page_tsx.chunk.js:4390:60
    at step (main.bundle.js:108906:17)
    at Object.next (main.bundle.js:108855:14)

To Reproduce (required) / 如何复现 bug?(必填,非常重要)

Steps to reproduce the behavior: / 详细复现步骤:

中文版示例:

  1. 打开 demo
  2. 页面渲染完成后,即报该错误信息 the getUserInfo request should not fetch, please check the condition。

Expected behavior (required) / 预期行为(必填,非常重要)

A clear and concise description of what did you expect to happen. / 请清晰和精确的描述你预期的行为

预期行为:希望页面中的getUserInfo该API请求可正常完成请求,并返回数据。

Screenshots (optional) / bug 截图(可选)

Sceenshots for further information. (If applicable.) / 一些有用的截图将会帮助我们更好的明确以及定位问题

报错截图:
image


Environments (please complete the following information) (required): / 请提供如下信息(必填)

  • AliLowCodeEngine version: [e.g. 1.0.0] / 低代码引擎版本:
    渲染引擎版本: @alilc/lowcode-react-renderer": "^1.1.11-alpha.5",

  • AliLowCodeEngineExt version: [e.g. 1.0.0] / 低代码引擎扩展包版本

  • Browser [e.g. chrome, safari] / 浏览器版本
    - 浏览器版本:版本 120.0.6099.216(正式版本) (x86_64)

  • materials / plugins / tools / 其他物料 / 插件 / 工具链版本

(this information can be collected via the manual plugin / 版本信息可通过低代码用户手册插件收集)

Additional context (optional) / 更多额外信息(可选)

Any other context of the problem here. / 可以追加更多的额外信息,帮助定位问题

@eternalsky
Copy link
Collaborator

请规范一下提的标题以及内容。

@eternalsky eternalsky added the insufficient information Further information is requested / 信息不足,请补充信息 label Jan 16, 2024
Copy link

你好 @yunnode,由于缺乏必要的信息(如 bug 重现步骤、引擎版本信息 等),无法定位问题,请按照 issue bug 模板 补全信息,也可以通过阅读 引擎的 issue 说明 了解什么类型的 issue 可以获得更好、更快的支持。

@yunnode
Copy link
Author

yunnode commented Jan 16, 2024

请规范一下提的标题以及内容。

好的

@yunnode yunnode changed the title 报错信息:Error: the getUserInfo request should not fetch, please check the condition 以下是我dataSource的配置 我dataSource配置好后,运行低代码引擎进行渲染,出现如下报错信息:Error: the getUserInfo request should not fetch, please check the condition。麻烦帮看下是哪个地方配置不标准或漏掉配置了么 Jan 16, 2024
@yunnode yunnode changed the title 我dataSource配置好后,运行低代码引擎进行渲染,出现如下报错信息:Error: the getUserInfo request should not fetch, please check the condition。麻烦帮看下是哪个地方配置不标准或漏掉配置了么 页面schema模板中dataSource配置好后,运行低代码引擎进行渲染,出现如下报错信息:Error: the getUserInfo request should not fetch, please check the condition。麻烦帮看下是哪个地方配置不标准或漏掉配置了么 Jan 16, 2024
@yunnode yunnode changed the title 页面schema模板中dataSource配置好后,运行低代码引擎进行渲染,出现如下报错信息:Error: the getUserInfo request should not fetch, please check the condition。麻烦帮看下是哪个地方配置不标准或漏掉配置了么 页面schema模板中dataSource配置好后,运行低代码引擎进行渲染,出现如下报错信息:Error: the getUserInfo request should not fetch, please check the condition。麻烦帮看下是什么原因导致没发出请求 Jan 16, 2024
@yunnode
Copy link
Author

yunnode commented Jan 16, 2024

请规范一下提的标题以及内容。

@eternalsky 您好,issue信息已调整,请帮看下问题,谢谢。

@YSMJ1994
Copy link
Collaborator

@yunnode 报错问题显示在 getUserInfo内 shouldFetch 表达式返回了非值,检查一下里面的表达式

@yunnode
Copy link
Author

yunnode commented Jan 17, 2024

@yunnode 报错问题显示在 getUserInfo内 shouldFetch 表达式返回了非值,检查一下里面的表达式


@YSMJ1994 麻烦问下,你说的shouldFetch 表达式返回了「非值」,是指这个函数返回了非true的值的意思么?

    "shouldFetch": {
      "type": "JSFunction",
      "value": "function updateUserInfo(res) { \n console.log('should fetch 2 ...'); \n console.log('getUserInfo res:', res); \nthis.setState({\n      stageData: res.data\n    });\n \nreturn res.data\n}"
    }

@yunnode
Copy link
Author

yunnode commented Jan 17, 2024

@yunnode 报错问题显示在 getUserInfo内 shouldFetch 表达式返回了非值,检查一下里面的表达式

你好,后来解决了,感谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
insufficient information Further information is requested / 信息不足,请补充信息
Projects
None yet
Development

No branches or pull requests

3 participants