You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm starting to use Vue and Vuex with typescript in a new project, but I need to support very old browser (Chrome >= 38), so I need to transpile into ES5.
I'm using VueJS 2.x because the new 3.x doesn't support transpiling to ES5 and all works fine, except for your package: during the initialization the app throws the error Uncaught TypeError: Object.getOwnPropertyNames called on non-object when executes addGettersToModule function. No errors on new browsers.
In ES5, if the argument to this method is not an object (a primitive), then it will cause a TypeError. In ES2015, a non-object argument will be coerced to an object.
My files:
// config.state.tsimport{RPConfig}from'./config.model';exportclassConfigState{publicconfig: RPConfig|null=null;}// config.module.tsimportaxiosfrom'axios';import{Module,VuexModule,MutationAction,getModule}from'vuex-module-decorators';import{RPConfig}from'./models/config.model';import{RPConfigDTO}from'./models/config.dto';import{ConfigState}from'./models/config.state';importstorefrom'@/store';
@Module({dynamic: true,name: 'config ', store })classRPConfigModuleextendsVuexModuleimplementsConfigState{config: RPConfig|null=null;/** * Verifica se il configuratore è stato scaricato * @returns boolean */getconfigIsReady(): boolean{returnthis.config!==undefined;}/** * RItorna la base URL della CDN * @returns string */getcdnBaseUrl(): string{returnthis.config ? this.config.cdnBaseUrl : '';}
@MutationActionupdate(payload: {configUrl: string}): Promise<{config: RPConfig}>{const{ configUrl }=payload;returnnewPromise((resolve,reject)=>{axios.get<RPConfigDTO>(configUrl).then((response)=>{resolve({config: RPConfig.fromConfigDTO(response.data)});},(err)=>{console.log(err);setTimeout(()=>{this.update(payload).then(resolve,reject);},5000);});});}}exportconstRPConfigState=getModule(RPConfigModule);// store.tsimportVuefrom'vue';importVuexfrom'vuex';import{ConfigState}from'./config/models/config.state';exportinterfaceRootState{config: ConfigState;}Vue.use(Vuex);exportdefaultnewVuex.Store<RootState>({});
Could you help me to solve that issue?
Thanks?
The text was updated successfully, but these errors were encountered:
Hi, I'm starting to use Vue and Vuex with typescript in a new project, but I need to support very old browser (Chrome >= 38), so I need to transpile into ES5.
I'm using VueJS 2.x because the new 3.x doesn't support transpiling to ES5 and all works fine, except for your package: during the initialization the app throws the error
Uncaught TypeError: Object.getOwnPropertyNames called on non-object
when executesaddGettersToModule
function. No errors on new browsers.On https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/getOwnPropertyNames I found the following:
My files:
Could you help me to solve that issue?
Thanks?
The text was updated successfully, but these errors were encountered: