这个错误通常是由于缺少解析组件的插件导致的。可以尝试执行以下步骤来解决问题:

  1. 确保已安装了vue-loader插件。可以通过运行以下命令来安装:

    npm install vue-loader --save-dev
    
  2. 确保已在webpack配置文件中正确配置了vue-loader。可以参考以下示例:

    const { VueLoaderPlugin } = require('vue-loader')
    
    module.exports = {
      // ...
      module: {
        rules: [
          // ...
          {
            test: /\.vue$/,
            loader: 'vue-loader'
          },
          // ...
        ]
      },
      plugins: [
        // ...
        new VueLoaderPlugin()
      ]
    }
    
  3. 如果上述步骤都没有解决问题,可以尝试清除npm缓存并重新安装依赖包。可以通过运行以下命令来清除npm缓存:

    npm cache clean --force
    

    然后,重新运行npm install命令来重新安装依赖包。

如果上述步骤都没有解决问题,请提供更多关于错误的详细信息,例如完整的错误堆栈跟踪信息和其他相关的配置文件内容,以便更好地帮助您解决问题

Module build failed from node_modulesvue-loaderlibindexjsTypeError Cannot read properties of undefined reading parseComponent报错const path = requirepathconst scssVariables = requiresrcstylesvariablessc

原文地址: http://www.cveoy.top/t/topic/iQ4V 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录