Home Game Development sys.localStorage crashes native builds. v3.6.1 – Cocos Creator

sys.localStorage crashes native builds. v3.6.1 – Cocos Creator

0
sys.localStorage crashes native builds. v3.6.1 – Cocos Creator

[ad_1]

Hello i’m making an attempt to make a local construct for Mac OS. When i do that the editor logs a whole lot of errors:

I do know it occurs provided that i’ve a reference to sys.localStorage in any class which is exported as const.

When i take away sys.localStorage from my code the editor makes a construct with out errors.

So right here an instance:

Screen Shot 2022-11-06 at 18.59.17

Screen Shot 2022-11-06 at 18.59.48

MainEnums.ts has just one line:
export const check = new Test()

Test.ts:

import {sys} from 'cc'

export class Test {
    constructor() {
        sys.localStorage.removeItem('check')
        const merchandise = sys.localStorage.getItem('check')
        sys.localStorage.setItem('check', "null")
    }
}

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here