Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
713 views
in Technique[技术] by (71.8m points)

reactjs - Setting up Environment Variables for Azure ABP.IO React Mobile App

I have created and deployed the abp.io project to Azure. I have created the DB and Web app successfully.

Now I exploring the React mobile front end. I am attempting to point the React app at localhost or the Azure server.

I have set the environment variables 'apiUrl' and 'issuer' to my IP and my azure website based on the documentation(https://docs.abp.io/en/abp/latest/Getting-Started-React-Native) and get the same error shown below.

Localhost Error:

Network Error

The above error occurred in task fetchAppConfig
    created by takeLatest(app/fetchAppConfigAsync, fetchAppConfig)
    created by _callee
    created by rootSaga
Tasks cancelled due to error:
takeLatest(app/fetchAppConfigAsync, fetchAppConfig)
takeLatest(app/setLanguageAsync, setLanguage)
takeLatest(app/logoutAsync, logout)

Azure Error:

Request failed with status code 500
- node_modulesaxioslibcorecreateError.js:15:17 in createError
- node_modulesaxioslibcoresettle.js:16:9 in settle
- node_modulesaxioslibadaptersxhr.js:53:6 in handleLoad
- node_modulesevent-target-shimdistevent-target-shim.js:818:20 in EventTarget.prototype.dispatchEvent
- node_modules
eact-nativeLibrariesNetworkXMLHttpRequest.js:592:4 in setReadyState
- node_modules
eact-nativeLibrariesNetworkXMLHttpRequest.js:395:6 in __didCompleteResponse   
- node_modules
eact-nativeLibrariesvendoremitterEventEmitter.js:189:10 in emit
- node_modules
eact-nativeLibrariesBatchedBridgeMessageQueue.js:416:4 in __callFunction
- node_modules
eact-nativeLibrariesBatchedBridgeMessageQueue.js:109:6 in __guard$argument_0  
- node_modules
eact-nativeLibrariesBatchedBridgeMessageQueue.js:364:10 in __guard
- node_modules
eact-nativeLibrariesBatchedBridgeMessageQueue.js:108:4 in callFunctionReturnFlushedQueue
* [native code]:null in callFunctionReturnFlushedQueue

The above error occurred in task fetchAppConfig
    created by takeLatest(app/fetchAppConfigAsync, fetchAppConfig)
    created by _callee
    created by rootSaga
Tasks cancelled due to error:
takeLatest(app/fetchAppConfigAsync, fetchAppConfig)
takeLatest(app/setLanguageAsync, setLanguage)
takeLatest(app/logoutAsync, logout)

Animated: `useNativeDriver` was not specified. This is a required option and must be explicitly set to `true` or `false`
.
.
.
* [native code]:null in callFunctionReturnFlushedQueue
question from:https://stackoverflow.com/questions/65838636/setting-up-environment-variables-for-azure-abp-io-react-mobile-app

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had the same problem And I did the following :

  1. Using HTTP, not HTTPS [I think this may solve your problem with azure]
  2. Using Conveyor to get a URL for my local web app instead of using localhost as the localhost is not defined for the mobile

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...