質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Google Cloud Platform

Google Cloud Platformは、Google社がクラウド上で提供しているサービス郡の総称です。エンドユーザー向けサービスと同様のインフラストラクチャーで運営されており、Webサイト開発から複雑なアプリ開発まで対応可能です。

Nuxt.js

Nuxt.jsは、ユニバーサルなSPAが開発可能なVue.jsベースのフレームワーク。UIの描画サポートに特化しており、SSRにおけるサーバーサイドとクライアントサイドのUIレンダリングなどさまざまな機能を持ちます。

Google App Engine

Google App Engineは、Googleの管理するデータセンター上でウェブアプリケーションの開発が可能なクラウドコンピュータ技術です。Java、Python、Go用にSDKが用意されています。

TypeScript

TypeScriptは、マイクロソフトによって開発された フリーでオープンソースのプログラミング言語です。 TypeScriptは、JavaScriptの構文の拡張であるので、既存の JavaScriptのコードにわずかな修正を加えれば動作します。

Q&A

解決済

1回答

874閲覧

nuxt.js 2.9 typescript Google App Engineのデプロイ後のエラーについて

laravel5

総合スコア32

Vue.js

Vue.jsは、Webアプリケーションのインターフェースを構築するためのオープンソースJavaScriptフレームワークです。

Google Cloud Platform

Google Cloud Platformは、Google社がクラウド上で提供しているサービス郡の総称です。エンドユーザー向けサービスと同様のインフラストラクチャーで運営されており、Webサイト開発から複雑なアプリ開発まで対応可能です。

Nuxt.js

Nuxt.jsは、ユニバーサルなSPAが開発可能なVue.jsベースのフレームワーク。UIの描画サポートに特化しており、SSRにおけるサーバーサイドとクライアントサイドのUIレンダリングなどさまざまな機能を持ちます。

Google App Engine

Google App Engineは、Googleの管理するデータセンター上でウェブアプリケーションの開発が可能なクラウドコンピュータ技術です。Java、Python、Go用にSDKが用意されています。

TypeScript

TypeScriptは、マイクロソフトによって開発された フリーでオープンソースのプログラミング言語です。 TypeScriptは、JavaScriptの構文の拡張であるので、既存の JavaScriptのコードにわずかな修正を加えれば動作します。

0グッド

1クリップ

投稿2019/09/04 08:13

編集2019/09/05 08:28

https://teratail.com/questions/209870
にて問題が解決しましたが、Google App Engineにデプロイすると
209870で質問した内容と同じエラーが発生します。
※ デプロイは成功していますが、同じエラーが出力されます。

何かご存知の方ご教授願えませんでしょうか?

※ nuxt.config.tsのbuildModulesの記述を外し、
npm run devを行うと
同様のエラーが発生する為、原因は、恐らく、下記の
nuxt.config.tsのbuildModulesの記述の部分か
package.json
のdevDependenciesのどちらかだと考えております。

nuxt.config.ts

buildModules: [ ['@nuxt/typescript-build', { typeCheck: true, ignoreNotFoundWarnings: true }] ]

package.json

"devDependencies": { "@nuxt/typescript-build": "^0.2.1",

###エラー内容

ログ確認 gcloud app logs tail -s default
ログ内容一部抜粋 ERROR Cannot read property 'get' of undefined at Store.check (server.js:1:0) at Array.wrappedActionHandler (node_modules/vuex/dist/vuex.common.js:734:23) at Store.dispatch (node_modules/vuex/dist/vuex.common.js:439:15) at boundDispatch (node_modules/vuex/dist/vuex.common.js:333:21) at Store.nuxtServerInit (server.js:1:0) at Array.wrappedActionHandler (node_modules/vuex/dist/vuex.common.js:734:23) at Store.dispatch (node_modules/vuex/dist/vuex.common.js:439:15) at Store.boundDispatch [as dispatch] (node_modules/vuex/dist/vuex.common.js:333:21) at e.default (server.js:1:0) (repeated 6 times)

ソース

package.json

{ "name": "test", "version": "2.8.0", "description": "nuxt.js project", "author": "test", "private": true, "scripts": { "dev": "nuxt-ts", "build": "nuxt-ts build", "start": "nuxt-ts start", "generate": "nuxt-ts generate", "lint": "eslint --ext .ts,.js,.vue --ignore-path .eslintignore .", "precommit": "npm run lint" }, "dependencies": { "@nuxt/typescript-runtime": "^0.1.5", "@nuxtjs/axios": "^5.6.0", "@nuxtjs/google-tag-manager": "^2.2.1", "@nuxtjs/proxy": "^1.3.3", "@nuxtjs/sitemap": "^1.2.0", "@nuxtjs/toast": "^3.2.1", "@sentry/browser": "^5.5.0", "@sentry/integrations": "^5.5.0", "@types/node": "^12.7.4", "algoliasearch": "^3.33.0", "anchorify": "^1.0.2", "autocomplete.js": "^0.36.0", "autolinker": "^3.1.0", "aws-serverless-express": "^3.3.6", "bootstrap": "^4.3.1", "bootstrap-vue": "^2.0.0-rc.26", "card-validator": "^6.2.0", "cookie": "^0.4.0", "cookie-universal-nuxt": "^2.0.16", "cookieparser": "^0.1.0", "cross-env": "^5.2.0", "date-time-format-timezone": "^1.0.21", "dotenv": "^8.0.0", "emoji-js": "^3.4.1", "env-parser": "^1.0.1", "escape-goat": "^2.1.0", "express": "^4.17.1", "japan-postal-code": "^0.2.0", "jquery": "^3.4.1", "jspdf": "^1.5.3", "laravel-echo": "^1.5.4", "luxon": "^1.17.1", "moment": "^2.24.0", "moment-timezone": "^0.5.26", "msgdown": "^1.0.2", "nuxt": "^2.8.1", "nuxt-basic-auth-module": "^1.2.0", "nuxt-client-init-module": "^0.1.4", "nuxt-device-detect": "^1.1.5", "popper.js": "^1.15.0", "pusher-js": "^4.4.0", "sanitize-html": "^1.20.1", "ts-node": "^8.3.0", "v-tooltip": "^2.0.2", "vue-autosuggest": "^2.0.1", "vue-awesome-swiper": "^3.1.3", "vue-clipboard2": "^0.3.0", "vue-datetime": "^1.0.0-beta.8", "vue-html2canvas": "0.0.4", "vue-instantsearch": "^2.2.2", "vue-intercom": "^1.0.14", "vue-kindergarten": "^0.3.3", "vue-loading-template": "^1.3.2", "vue-property-decorator": "^8.2.1", "vue-slide-up-down": "^1.7.2", "vue-the-mask": "^0.11.1", "vue-tippy": "^2.1.3", "vuejs-datepicker": "^1.6.2", "vuelidate": "^0.7.4", "vuex-persistedstate": "^2.5.4", "vuex-storage-sync": "^1.1.6", "weekstart": "^1.0.0" }, "devDependencies": { "@nuxt/typescript-build": "^0.2.1", "@typescript-eslint/eslint-plugin": "^1.12.0", "@typescript-eslint/parser": "^1.12.0", "acorn": "^6.2.0", "acorn-dynamic-import": "^4.0.0", "babel-eslint": "^10.0.2", "eslint": "^5.0.0", "eslint-config-prettier": "^6.0.0", "eslint-friendly-formatter": "^4.0.1", "eslint-loader": "^2.2.1", "eslint-plugin-prettier": "3.1.0", "eslint-plugin-vue": "^5.2.3", "node-sass": "^4.12.0", "nodemon": "^1.19.1", "npm-run-all": "^4.1.5", "prettier": "^1.18.2", "sass-loader": "^7.1.0" }, "browserslist": [ "last 2 version", "android >= 4.4", "IE 11" ] }

nuxt.config.ts

import generateUrlFromResource from './services/GenerateUrlFromResource' const webpack = require('webpack') const path = require('path') const axios = require('axios') let envPath = './.env' if (process.env.NODE_ENV === 'production') { envPath = './.env.prod' } else if (process.env.NODE_ENV === 'staging') { envPath = './.env.stg' } const Parsed = require('dotenv').config({ path: envPath }).parsed module.exports = { buildModules: [ ['@nuxt/typescript-build', { typeCheck: true, ignoreNotFoundWarnings: true }] ], typescript: { typeCheck: true, ignoreNotFoundWarnings: true }, router: { linkExactActiveClass: 'active-link' }, env: { ...Parsed }, head: { title: 'test', meta: [ { charset: 'utf-8' }, { hid: 'viewport', name: 'viewport', content: 'width=device-width, initial-scale=1' }, { name: 'google-site-verification', content: '9st-McgIso5v__qoLTVTrX81FXW2HxbAI5c3-6U1LX0' } ], link: [ { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }, { rel: 'stylesheet', href: '//maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css' } ], script: [ { src: '//ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js'}, { src: '/fitie.js' }, { src: 'https://cdn.polyfill.io/v2/polyfill.min.js?features=default,fetch,Object.entries,String.prototype.repeat,Array.prototype.find,Array.prototype.findIndex,Math.trunc,Intl.~locale.ja' } ] }, watchQuery: true, modules: [ '@nuxtjs/axios', '@nuxtjs/proxy', '@nuxtjs/toast', '@nuxtjs/sitemap', 'bootstrap-vue/nuxt', 'nuxt-device-detect', 'cookie-universal-nuxt', 'nuxt-client-init-module', 'nuxt-basic-auth-module', ['@nuxtjs/google-tag-manager', {id: Parsed.GTM_TAG_ID, pageTracking: true }] ], basic: { name: 'test', pass: 'test', enabled: process.env.NODE_ENV === 'staging' }, axios: { credentials: true, baseUrl: '/api' }, proxy: { '/api/': JSON.stringify(Parsed.API_URL) }, build: { plugins: [ new webpack.ProvidePlugin({ $: 'jquery', jQuery: 'jquery', 'window.jQuery': 'jquery' }) ], vendor: [ 'vue-awesome-swiper' ], extend (config, { isDev, isClient }) { if (isDev && isClient) { config.module.rules.push({ enforce: 'pre', test: /.(js|vue)$/, loader: 'eslint-loader', exclude: /(node_modules)/ }) } config.resolve.alias['services'] = path.join(__dirname, 'services') } }, plugins: [ '~/plugins/axios.js', '~/plugins/algoliasearch.js', '~/plugins/bootstrap.js', '~/plugins/filters.js', '~/plugins/global.js', '~/plugins/moment.js', '~/plugins/mixins/flash.js', '~/plugins/mixins/form-handler.js', '~/plugins/mixins/user.js', '~/plugins/v-tooltip', '~/plugins/vue-autosuggest', '~/plugins/vue-clipboard2', '~/plugins/vue-datetime', '~/plugins/vue-intercom', '~/plugins/vue-the-mask', '~/plugins/vuelidate.js', '~/plugins/truncate.js', { src: '~/plugins/sentry.js' }, { src: '~/plugins/tippy.js', ssr: false }, { src: '~/plugins/laravel-echo.js', ssr: false }, { src: '~/plugins/vue-loading.js', ssr: false }, { src: '~/plugins/vuex-persistedstate', ssr: false }, { src: '~/plugins/jspdf', ssr: false }, { src: '~/plugins/html2canvas', ssr: false }, { src: '~plugins/vue-awesome-swiper', ssr: false }, { src: '~/plugins/router-option.js', ssr: false } ], toast: { position: 'bottom-left', duration: 2000 }, loading: { name: 'chasing-dots', color: '#ff5638', background: 'white', height: '4px' }, sitemap: { path: '/sitemap.xml', hostname: Parsed.BASE_URL, cacheTime: 1000 * 60 * 15, gzip: true, generate: false, // Enable me when using nuxt generate exclude: [ '/test', '/test1', '/test2/**' ], routes (callback) { axios.get(Parsed.API_URL + '/sitemap') .then(response => { const productRoutes = generateUrlFromResource(response.data.products, 'product') const categoryRoutes = generateUrlFromResource(response.data.categories, 'category') callback(null, productRoutes.concat(categoryRoutes)) }) .catch(callback) } } }

tsconfig.json

{ "compilerOptions": { "types": [ "@nuxt/types", "@types/node" ] } }

###補足情報(FW/ツールのバージョンなど)
Nuxt.js(SSR) v2.9.2
Vue.js 3.8.4

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

デプロイ実行時にnuxt-ts buildを実行しないといけなかったのですが、
誤って nuxt buildを実行していました。

GAE上で問題無くNuxt.js2.9(SSR) typescriptは動作します。

投稿2019/09/06 09:46

laravel5

総合スコア32

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問