Building in Production -> put to the Server

give an error: Vuex handler functions must not be anonymous.
Resolve:
npm cache clean --force
npm install
npm i npm@latest -g
This commit is contained in:
paolo
2018-12-22 23:30:02 +01:00
parent bd832d3f92
commit 02e5725ba9
6 changed files with 10 additions and 33 deletions

View File

@@ -11,15 +11,11 @@
"pwa": "NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m pwa", "pwa": "NODE_OPTIONS=--max_old_space_size=4096 DEBUG=v8:* quasar dev -m pwa",
"test:unit": "jest", "test:unit": "jest",
"test:cover": "jest --coverage", "test:cover": "jest --coverage",
"build": "quasar build", "build": "quasar build -m pwa",
"build:pwa": "quasar build -m pwa",
"build:ssr": "quasar build -m ssr",
"build:clean": "quasar clean", "build:clean": "quasar clean",
"serve": "quasar serve ./dist/pwa-mat", "serve": "quasar serve ./dist/pwa-mat",
"serve:ssr": "quasar serve ./dist/ssr-mat",
"serve:coverage": "quasar serve test/coverage/lcov-report/ --cache 0 --port 8788", "serve:coverage": "quasar serve test/coverage/lcov-report/ --cache 0 --port 8788",
"deploy": "now dist/spa-mat", "deploy": "now dist/pwa-mat"
"deploy:ssr": "now dist/ssr-mat"
}, },
"dependencies": { "dependencies": {
"quasar-extras": "^2.0.8", "quasar-extras": "^2.0.8",

View File

@@ -39,7 +39,7 @@
created() { created() {
//this.title = 'My Vue and CosmosDB Heroes App' //this.title = 'My Vue and CosmosDB Heroes App'
console.info(process.env) // console.info(process.env)
UserStore.mutations.autologin() UserStore.mutations.autologin()
} }
} }

View File

@@ -12,14 +12,11 @@ const state: IGlobalState = {
} }
const b = storeBuilder.module<IGlobalState>('GlobalModule', state) const b = storeBuilder.module<IGlobalState>('GlobalModule', state)
const stateGetter = b.state()
// Getters // Getters
namespace Getters { namespace Getters {
const conta = b.read(function conta(state): number { const conta = b.read(state => state.conta , 'conta')
return state.conta
})
export const getters = { export const getters = {
get conta() { get conta() {
@@ -51,6 +48,8 @@ namespace Actions {
} }
const stateGetter = b.state()
// Module // Module
const GlobalModule = { const GlobalModule = {
get state() { return stateGetter()}, get state() { return stateGetter()},

View File

@@ -1,7 +1,4 @@
import Vuex, { Store } from 'vuex'
import Vue from 'vue'
import {RootState} from '@store' import {RootState} from '@store'
import { getStoreBuilder } from 'vuex-typex' import { getStoreBuilder } from 'vuex-typex'
Vue.use(Vuex)
export const storeBuilder = getStoreBuilder<RootState>() export const storeBuilder = getStoreBuilder<RootState>()

View File

@@ -1,4 +1,3 @@
import Api from '@api' import Api from '@api'
import { ISignupOptions, ISigninOptions, IUserState } from 'model' import { ISignupOptions, ISigninOptions, IUserState } from 'model'
import { ILinkReg, IResult, IIdToken } from 'model/other' import { ILinkReg, IResult, IIdToken } from 'model/other'
@@ -8,8 +7,6 @@ import router from '@router'
import { serv_constants } from '../Modules/serv_constants' import { serv_constants } from '../Modules/serv_constants'
import { rescodes } from '../Modules/rescodes' import { rescodes } from '../Modules/rescodes'
const bcrypt = require('bcryptjs') const bcrypt = require('bcryptjs')
@@ -34,15 +31,15 @@ const stateGetter = b.state()
namespace Getters { namespace Getters {
const lang = b.read(function lang(state): string { const lang = b.read(state => {
if (state.lang !== '') { if (state.lang !== '') {
return state.lang return state.lang
} else { } else {
return process.env.LANG_DEFAULT return process.env.LANG_DEFAULT
} }
}) }, 'lang')
const tok = b.read(function tok(state): string { const tok = b.read(state => {
if (state.tokens) { if (state.tokens) {
if (typeof state.tokens[0] !== 'undefined') { if (typeof state.tokens[0] !== 'undefined') {
return state.tokens[0].token return state.tokens[0].token
@@ -52,7 +49,7 @@ namespace Getters {
} else { } else {
return '' return ''
} }
}) }, 'tok')
export const getters = { export const getters = {
get lang() { get lang() {

View File

@@ -22,15 +22,3 @@ export { default as Api } from './Api'
const store: Store<RootState> = getStoreBuilder<RootState>().vuexStore() const store: Store<RootState> = getStoreBuilder<RootState>().vuexStore()
export default store export default store
// export function createStore() {
// const store: Store<RootState> = storeBuilder.vuexStore({
// strict: DebugMode
// })
//
// return store
//
// }
// export default new Vuex.Store<RootState>({
// })