uniapp: run real machine 'getItem' of undefined error

The h5 is running normally, and the following error occurs in the uniapp real machine debugging: 

reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack ->Uncaught TypeError: Cannot read property 'getItem' of undefined
19:41:23.973 at  (app-service.js:6028:39)
19:41:24.004 at  (app-service.js:6743:3)

There is no cookie, session.storage in uniapp. Change to

  1. uni.setStorageSync(KEY, DATA)
  2. uni.getStorage(OBJECT)

can

Guess you like

Origin blog.csdn.net/Motion_zq/article/details/126752487