Status: [OPEN]
Created: 2026-05-28
UniApp 真机运行报错白屏: reportJSException >>>> exception function:createInstanceContext, exception:white screen cause create instanceContext failed,check js stack -> at s (app-service.js:15:401) at (app-service.js:942:153013) at (app-service.js:1041:51133)
modern-compiler API 不兼容真机环境legacy, issue persists?.、空值合并 ??、BigInt 等modern-compiler to legacyFOUND ISSUE: Project uses extensive ES2020 syntax that is not supported in older JavaScriptCore:
- Optional chaining (?.) - found 100+ occurrences
- Nullish coalescing (??) - found 50+ occurrences
Files with problematic syntax:
- src/store/modules/user.ts
- src/utils/versionUpgrade.js
- src/pages/sales/salesQuotation/*.vue
- src/pages/productionManagement/**/*.vue
- src/pages/oa/_utils/*.js
- Many more...
Updated vite.config.js to set build target to ES2015 to ensure proper transpilation of ES2020 syntax.
CRITICAL ISSUE: In useFinReimburseForm.js, useUserStore() was called at module level (line 37), which causes Pinia store initialization before Vue app context is ready.
This is the main cause of createInstanceContext failed error!
useFinReimburseForm.js to use lazy initialization patterngetUserStore() is called within function scopelegacyes2015<div> to <view>rd /s /q dist