Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[nuxt-i18n] Error: Cannot find module 'vue-template-compiler' #42

Closed
robinscholz opened this issue May 8, 2019 · 7 comments
Closed
Labels
bug Something isn't working

Comments

@robinscholz
Copy link

The Nuxt.js app deploys, but I get the following error in my Output logs:

λ Error while initializing nuxt: { /var/task/node_modules/nuxt-i18n/src/helpers/components.js:1
Error: Cannot find module 'vue-template-compiler'
Require stack:
- /var/task/node_modules/nuxt-i18n/src/helpers/components.js
- /var/task/node_modules/nuxt-i18n/src/helpers/routes.js
- /var/task/node_modules/nuxt-i18n/src/index.js
- /var/task/node_modules/@nuxt/core/dist/core.js
- /var/task/now__launcher.js
- /var/runtime/node_modules/awslambda/index.js
    at Object.<anonymous> (/var/task/node_modules/nuxt-i18n/src/helpers/components.js:6:18)
    at Object.<anonymous> (/var/task/node_modules/nuxt-i18n/src/helpers/components.js:1)
  code: 'MODULE_NOT_FOUND',
  requireStack: 
   [ '/var/task/node_modules/nuxt-i18n/src/helpers/components.js',
     '/var/task/node_modules/nuxt-i18n/src/helpers/routes.js',
     '/var/task/node_modules/nuxt-i18n/src/index.js',
     '/var/task/node_modules/@nuxt/core/dist/core.js',
     '/var/task/now__launcher.js',
     '/var/runtime/node_modules/awslambda/index.js' ] }

Any idea how to fix this? Shouldn‘t vue-template-compiler be a core dependency of nuxt?

@pi0
Copy link
Member

pi0 commented May 8, 2019

Hi. Can you please share package.json?

@pi0 pi0 added the question Further information is requested label May 8, 2019
@MarvinMiles
Copy link

MarvinMiles commented May 9, 2019

Had same error with nuxt-i18n. Fixed by adding vue-template-compiler to core dependency, as you said.

@robinscholz
Copy link
Author

package.json @pi0

"dependencies": {
    "@nuxtjs/axios": "^5.3.6",
    "@nuxtjs/dotenv": "^1.3.0",
    "@nuxtjs/pwa": "^2.6.0",
    "cors": "^2.8.5",
    "cross-env": "^5.2.0",
    "express": "^4.16.4",
    "intersection-observer": "^0.5.1",
    "markdown-it": "^8.4.2",
    "nodemailer": "^6.1.0",
    "nuxt": "^2.4.0",
    "nuxt-i18n": "^5.8.5",
    "validator": "^10.11.0",
    "vue-smooth-reflow": "^0.1.12",
    "vuex-router-sync": "^5.0.0",
    "xss-filters": "^1.2.7"
  },
  "devDependencies": {
    "@kazupon/vue-i18n-loader": "^0.3.0",
    "@nuxtjs/eslint-config": "^0.0.1",
    "@nuxtjs/style-resources": "^0.1.2",
    "babel-eslint": "^8.2.1",
    "eslint": "^5.0.1",
    "eslint-config-prettier": "^3.1.0",
    "eslint-config-standard": ">=12.0.0",
    "eslint-loader": "^2.0.0",
    "eslint-plugin-import": ">=2.14.0",
    "eslint-plugin-jest": ">=21.24.1",
    "eslint-plugin-node": ">=7.0.1",
    "eslint-plugin-prettier": "2.6.2",
    "eslint-plugin-promise": ">=4.0.1",
    "eslint-plugin-standard": ">=4.0.0",
    "eslint-plugin-vue": "^5.0.0",
    "glob-all": "^3.1.0",
    "node-sass": "^4.11.0",
    "nodemon": "^1.18.9",
    "postcss-prepend-imports": "^1.0.1",
    "postcss-preset-env": "^6.6.0",
    "precss": "^4.0.0",
    "prettier": "1.14.3",
    "purgecss-webpack-plugin": "^1.5.0",
    "sass-loader": "^7.1.0",
    "tailwindcss": "^0.7.4"
  }

@robinscholz
Copy link
Author

Had same error. Fixed by adding vue-template-compiler to core dependency, as you say.

How exactly did you add vue-template-compiler? Just via yarn add?

@MarvinMiles
Copy link

Just via yarn add?

Yep

@robinscholz
Copy link
Author

Thanks, that solved it!

@pi0 pi0 added bug Something isn't working and removed question Further information is requested labels May 9, 2019
@pi0
Copy link
Member

pi0 commented May 9, 2019

Please note that adding dependency is a temporary workaround. I've reported the issue to nuxt-i18n repo.

@pi0 pi0 changed the title Error: Cannot find module 'vue-template-compiler' [nuxt-i18n] Error: Cannot find module 'vue-template-compiler' May 9, 2019
@pi0 pi0 closed this as completed May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants