Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/webpack/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 使用nextjs导入bulma时,令牌无效或意外令牌_Reactjs_Webpack_Next.js_Bulma - Fatal编程技术网

Reactjs 使用nextjs导入bulma时,令牌无效或意外令牌

Reactjs 使用nextjs导入bulma时,令牌无效或意外令牌,reactjs,webpack,next.js,bulma,Reactjs,Webpack,Next.js,Bulma,我正试图将bulma与next.js一起使用,但我不断收到以下错误无效令牌或意外令牌 “./node_modules/bulma/css/bulma.css:2”@-webkit为spinAround{设置关键帧,这是bulma.css中的第一行 这是我的next.config.js文件和webpack配置。我缺少什么吗 const path = require("path"); const glob = require("glob"); module.exports = { webpac

我正试图将
bulma
next.js
一起使用,但我不断收到以下错误
无效令牌或意外令牌
“./node_modules/bulma/css/bulma.css:2”@-webkit为spinAround{
设置关键帧,这是
bulma.css
中的第一行

这是我的
next.config.js
文件和
webpack
配置。我缺少什么吗

const path = require("path");
const glob = require("glob");

module.exports = {
  webpack: (config, { dev }) => {
    config.module.rules.push(
      {
        test: /\.css$/,
        use: [
          'style-loader',
          { loader: 'css-loader', options: { importLoaders: 1 } }
        ]
      }
    )
    return config;
  }
}

你有
.babelrc
?@Aaqib是的,我有,这里是:
{“预设”:[“下一个/babel”],“忽略”:[]}
npm安装-保存dev babel-preset-stage-0 babel-preset-es2015
,然后将其添加到
中的预设中。babelrc
类似于
{预设:['stage-0','es2015','react','next']}
,还是一样的问题。我认为这一定是css加载器的问题,或者是其中一个语法错误:…/node_modules/bulma/bulma.sass:2@charset“utf-8”^SyntaxError:Invalid or unexpected token@./node_modules/bulma/css/bulma.css 4:14-124 18:2-22:4 19:20-130@./node_modules/reactbulma/lib/components/index.js@./sections/hero.js@./pages?entry@multi./pages?entry你有
.babelrc
吗?@Aaqib是的,这里是:
{“预设”:“next/babebl”,“忽略”:[]}
npm安装——保存dev babel-preset-stage-0 babel-preset-es2015
,然后将其添加到
中的预设中。babelrc
类似于
{presets:['stage-0'、'es2015'、'react'、'next']}
@Aaqib,还是同样的问题。我认为这一定是
css加载程序的问题,或者是其中一个
语法错误:…/node\u modules/bulma/bulma.sass:2@charset“utf-8“^SyntaxError:无效或意外标记@./node_modules/bulma/css/bulma.css 4:14-124 18:2-22:4 19:20-130@./node_modules/reactbulma/lib/components/index.js@./sections/hero.js@./pages?entry@multi./pages?entry