欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

File was processed with these loaders:

程序员文章站 2022-03-07 09:25:51
...

在component中加了一段css代码后 运行报错:

<style lang="stylus" scoped>
 .app-container {
    padding-top: 40px;
  }
</style>

Module parse failed: Unexpected token (18:0)
File was processed with these loaders:
 * ./node_modules/aaa@qq.com@vue-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.

File was processed with these loaders:

以为自己少装插件配置的问题:

一顿重装插件:

cnpm i vue-template-compiler -D

 报错!

cnpm i vue-loader-plugin -S

报错!

cnpm i -D postcss-loader

报错!

cnpm i css-loader -D

报错!

cnpm i vue -S

检查配置:webpack.config.js

const VueLoaderPlugin = require('vue-loader/lib/plugin');
module.exports = {
    plugins: [//所有 webpack 插件的配置节点
...
        new VueLoaderPlugin()
    ],
}

没有问题

最后回看我写的css 引用了"lang="stylus"" ...手快选了一个。。 然而并没有安装这个配置。

File was processed with these loaders:

File was processed with these loaders:

改回 

<style lang="scss" scoped>
  .app-container {
    padding-top: 40px;
  }
</style>

运行成功!

相关标签: 踩坑记录