Tag Archives: uniapp

crypto-js Error: Malformed UTF-8 data [How to Solve]

Crypto js Malformed UTF-8 data

Note: If your application is started by jar package, please refer to solution 1; If your application is started by tomcat, please refer to solution 2.

Solution 1: jar package startup configuration

 java -jar -Dfile.encoding=utf-8 itemapi-1.0.1.jar

Solution 2: tomat configuration

Set up in Tomcat’s catalina.bat.

set "JAVA_OPTS=%JAVA_OPTS% %LOGGING_CONFIG% -Dfile.encoding=UTF-8"

[Solved] HBuilder Error: Cannot read property ‘forceUpdate‘ of undefined

Using the project developed by HBuilderX, WeChat develop tool report an error:

Cannot read property ‘forceUpdate’ of undefined

The solution is shown in the figure:

In the project directory, find manifest.json – WeChat applet configuration – configure “WeChat applet AppID”

Open the developer tool, view the corresponding appid, fill in the upper part, and refresh the developer tool.

If you continue to report this error, restart hbuildx and wechat developer tools after configuration, and re run the project.

 

Uniapp: TypeError: Cannot read property ‘apply‘ of undefined (H5 does not report an error, but the real machine runs with an error)

When the real machine is running, the console reports an error:

[JS Framework] Failed to execute the callback function:
TypeError: Cannot read property ‘apply’ of undefined

it is recommended to check whether the function in settimout | setinterval is written in full callback function:
before modification:

after modification:

no error after modification

[Solved] uni app TypeError: undefined is not an object (evaluating ‘modules[moduleId].call‘) __ERROR

The project runs normally on H5. When it is debugged and opened with the real machine, the app reports an error and a white screen appears.

Scene reproduction:

If the route jumps to the toapproval page, the above problem will occur.

Troubleshooting:

After step-by-step positioning and troubleshooting, the problem appears in the component of toapproval page

Firstly, the toapproval page is under the main business pages folder, but the workflowdetail component of this page is imported from the subcontracting pagesoa folder. This leads to a white screen in the business jump during real machine debugging. However, it is not so strict in H5 browser, so this problem will not occur and it is not easy to locate the problem.

Solution:

If you find the problem, you can easily solve it. You can change the name of this component, copy it to the components folder, and import it from the components folder again.

Uni-app Error when assigning a value to a component: [system] TypeError: Cannot read property ‘name‘ of undefined

[system] TypeError: Cannot read property ‘name’ of undefined

This error occurs because some of the attributes in your curly brackets are undefined
1. Wrong attribute name
2. Another case: when the data is obtained asynchronously, there is no such data attribute during initialization
in my case, case 2, the value of the string is relatively deep, and the definition is only one level up
value structure:

{
    "id": 105,
    ...
    "dealer": {
        "sn": null,
        "password": null,
        "name": "xx",
        "departmentSn": null,
    },
    ...
},
		<view class="content-row">
			 <text class="cause">待处理:</text>
			 <text class="cause-detail" v-if="claim_detail_basic_list" >{{claim_detail_basic_list.dealer.name}}</text>
			</view>

This side has done error prevention processing

v-if="claim_detail_basic_list"

Because the value object has to be further “claim”_ detail_ basic_ List. Dealer. Name ”

chunk-vendors.js:3874 [Vue warn]: Error in render: "TypeError: Cannot read property 'name' of undefined"

The solution can go one step further.

<view class="content-row">
			 <text class="cause">ToDoList:</text>
			 <text class="cause-detail" v-if="claim_detail_basic_list.dealer" >{{claim_detail_basic_list.dealer.name}}</text>
			</view>

{{claim_ detail_ basic_ List. Dealer. Name}
OK! Reason: the deep object was not created and there was no attribute of the object when it was initialized.

40125,“errmsg“: “invalid appsecret, view more at http://t.cn/RAEkdV

Uniapp development of small programs, access to user information, request back to the background

{
	40125,"errmsg": "invalid appsecret, 
	view more at http://t.cn/RAEkdV
}

WeChat official account platform

After logging in, find the development management

and get appid in the development management

and then you can get the user information and request the background

Invalid Host header

Error reporting due to intranet penetration

Invalid Host header

Project root directory manifest. JSON — & gt; Source view – & gt; Add – & gt;

 		"devServer" : {
			"disableHostCheck":true
         },

Using uniapp uni.downloadFile Download picture to photo album times error unknown problem

Suppose we upload a JPG image. When we upload using OSS, if we specify that the content type is image/jpeg, the generated outer chain will be displayed directly on the browser. If the set content type is application/octet stream or multipart/form data, the external link is downloaded directly. In the final analysis, the content type in the response header indicates what type the browser is, rather than judging by the URL suffix jpg

First of all, you need to pay attention to the type of image to download. Content type is image/jpeg type. If it is image/JPG type, it may lead to the problem of unknown