Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.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 Cypress错误:TypeError:webpack.ProvidePlugin在tsconfig.json中使用baseUrl时不是构造函数_Reactjs_Typescript_Cypress - Fatal编程技术网

Reactjs Cypress错误:TypeError:webpack.ProvidePlugin在tsconfig.json中使用baseUrl时不是构造函数

Reactjs Cypress错误:TypeError:webpack.ProvidePlugin在tsconfig.json中使用baseUrl时不是构造函数,reactjs,typescript,cypress,Reactjs,Typescript,Cypress,我已经在cypress中为我的应用程序编写了一些测试——在我将baseUrl添加到tsconfig.json之前,一切正常。一旦我添加它,我就会得到错误: The function exported by the plugins file threw an error. We invoked the function exported by C:\....\cypress\plugins\index.js, but it threw an error. TypeError: webpack.Pr

我已经在cypress中为我的应用程序编写了一些测试——在我将baseUrl添加到tsconfig.json之前,一切正常。一旦我添加它,我就会得到错误:

The function exported by the plugins file threw an error.
We invoked the function exported by C:\....\cypress\plugins\index.js, but it threw an error.
TypeError: webpack.ProvidePlugin is not a constructor
我想使用baseUrl,但我不确定如何解决这个问题


有什么想法吗?

对于遇到同样问题的其他人来说,问题在于文件命名!我有我的webpack配置文件名“webpack.js”,Cypress似乎在找到真正的webpack之前就找到了它,并对此感到困惑。将webpack配置文件的名称更改为其他名称可以解决此问题。