Unable to perform HTTP request while testing on physical device

Panel mini-program development related product technical discussions, including panel mini-programs, intelligent mini-programs, React Native, Ray cross-platform framework, Panel SDK, WeChat mini-programs, mini-program development tools (IDE), and other related development technologies.


Post Reply
Fadikk367
Posts: 2

Hi everyone,
We are developing a simple Smart Mini App that communicates with our custom backend. We have a problem with testing the app on real device (Live Preview feature, scanning QR code from the IDE) because we are unable to perform a single outgoing HTTP request...

ty.request({
      url: '<CUSTOM_BACKEND_URL>',
      header: '<AUTH INFO>',
      complete: () => {
        console.log('complete')
      },
      success: (data) => {
        console.log('success', data) // NEVER CALLED
      },
      failure: (error) => {
        console.log('failure', error)  // NEVER CALLED
      },
    })

While complete callback is called both success and failure are never invoked so we have no idea what is going on. In the IDE it works as expected. Does anyone came across similar issue maybe?

User avatar
智能小程序管理员
Posts: 45

Re: Unable to perform HTTP request while testing on physical device

  1. Please check this doc https://developer.tuya.com/en/miniapp/guide/audit.
  2. Check the complete func args
  3. You can use Remote Debugger to view the log .https://developer.tuya.com/en/miniapp/d ... mote-debug
Fadikk367
Posts: 2

Re: Unable to perform HTTP request while testing on physical device

涂鸦张凯 2023年 Nov 21日 17:43
  1. Please check this doc https://developer.tuya.com/en/miniapp/guide/audit.
  2. Check the complete func args
  3. You can use Remote Debugger to view the log .https://developer.tuya.com/en/miniapp/d ... mote-debug

Thank you very much! It turned out that we were missing explicitly listing our server domain name on the allowlist -> https://developer.tuya.com/en/miniapp/g ... quirements. The only strange thing was that we weren't getting any error saying that this domain is not listed. Thanks one again.

Post Reply