小编Har*_*hah的帖子

模块构建失败:错误:没有解析器且没有给出文件路径,无法推断nuxtjs中的解析器

    Module build failed: Error: No parser and no file path given, couldn't infer a parser.
    at normalize (/home/nayan/dd_pwa/node_modules/prettier/index.js:7051:13)
    at formatWithCursor (/home/nayan/dd_pwa/node_modules/prettier/index.js:10370:12)
    at /home/nayan/dd_pwa/node_modules/prettier/index.js:31115:15
    at Object.format (/home/nayan/dd_pwa/node_modules/prettier/index.js:31134:12)
    at Object.module.exports (/home/nayan/dd_pwa/node_modules/vue-loader/lib/template-compiler/index.js:80:23)

 @ ./layouts/error.vue 7:0-368
 @ ./.nuxt/index.js
 @ ./.nuxt/client.js
 @ multi webpack-hot-middleware/client?name=client&reload=true&timeout=30000&path=/__webpack_hmr ./.nuxt/client.js
Run Code Online (Sandbox Code Playgroud)

我在Nuxtjs上遇到了同样的问题.任何面临同样问题的人 救命?!!版本:"nuxt":"^ 1.0.0","更漂亮":"^ 1.12.1"

尝试了降级和升级更漂亮版本的所有选项.

vue.js vue-component vuejs2 prettier

10
推荐指数
2
解决办法
1万
查看次数

使用 Nuxt JS 进行 Vuetify js 优化

我们使用 Nuxtjs 2.3.4 和 VuetifyJS 1.2.10。

每个页面上都有很多来自 VuetifyJs 的未使用的 CSS 和 js。

如何从每个页面中删除不需要的 VuetifyJs css/js?

谁能帮忙!!

javascript webpack vuejs2 nuxt.js vuetify.js

5
推荐指数
1
解决办法
5134
查看次数

TypeError:无法使用NUXT 2.4.5将模块名称空间属性'_nuxtConfigFile'添加到nuxt.config.js中

我正在升级到Nuxt 2.4.5并遇到以下错误 TypeError: Cannot add module namespace property '_nuxtConfigFile' to nuxt.config.js

javascript nuxt.js

4
推荐指数
1
解决办法
702
查看次数

当访问令牌过期并且我们需要再次登录以继续作为普通用户时,我们如何保持用户登录

我在代理中使用Nuxt-axios模块。

对于错误处理,我在

插件/axios.js

export default function({ $axios, __isRetryRequest, store, app, redirect , payload , next}) {
  $axios.onRequest(config => {
  if (app.$cookies.get('at') && app.$cookies.get('rt') && config.url != '/post_login/') {
      config.headers.common['Authorization'] = `Bearer ${app.$cookies.get('at')}`;
    }
  });

  $axios.onResponseError(err => {
    const code = parseInt(err.response && err.response.status)

    let originalRequest = err.config;

    if (code === 401) {
      originalRequest.__isRetryRequest = true;

      store
        .dispatch('LOGIN', { grant_type: 'refresh_token', refresh_token: app.$cookies.get('rt')})
        .then(res => {
          originalRequest.headers['Authorization'] = 'Bearer ' + app.$cookies.get('at');
          return app.$axios(originalRequest);
        })
        .catch(error => {
          console.log(error); …
Run Code Online (Sandbox Code Playgroud)

javascript axios refresh-token vuejs2 nuxt.js

1
推荐指数
1
解决办法
5920
查看次数