Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/23.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 PNG语法错误:无效或意外标记_Reactjs_Webpack - Fatal编程技术网

Reactjs PNG语法错误:无效或意外标记

Reactjs PNG语法错误:无效或意外标记,reactjs,webpack,Reactjs,Webpack,尝试在我的代码中使用png文件: import testImg from './test.png'; 并获取以下错误: SyntaxError: Invalid or unexpected token 我知道这是一个问题的网页,目前有以下在网页中有关的图像 { test: /\.(png|jpg|gif|svg)$/, loader: 'file-loader', options: { name: '[name].[ext]?[hash]' }

尝试在我的代码中使用png文件:

import testImg from './test.png';
并获取以下错误:

 SyntaxError: Invalid or unexpected token
我知道这是一个问题的网页,目前有以下在网页中有关的图像

 {
    test: /\.(png|jpg|gif|svg)$/,
    loader: 'file-loader',
    options: {
      name: '[name].[ext]?[hash]'
    }
  },
所以我不太清楚为什么我会犯这样的错误,有什么想法吗