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
Angular webpack--config webpack.config.vendor.js导致类型错误:dep.getResourceIdentifier不是函数_Angular_Webpack_Visual Studio 2017_Asp.net Core 2.0 - Fatal编程技术网

Angular webpack--config webpack.config.vendor.js导致类型错误:dep.getResourceIdentifier不是函数

Angular webpack--config webpack.config.vendor.js导致类型错误:dep.getResourceIdentifier不是函数,angular,webpack,visual-studio-2017,asp.net-core-2.0,Angular,Webpack,Visual Studio 2017,Asp.net Core 2.0,在visual studio 2017和visual studio 2017预览中,我将从模板创建一个新的ASP.Net Core 2.1 Angular应用程序。不幸的是,每次我尝试运行webpack--config webpack.config.vendor.js时,我都会收到 TypeError: dep.getResourceIdentifier is not a function at addDependency (C:\Users\bdellinger\AppData\Ro

在visual studio 2017和visual studio 2017预览中,我将从模板创建一个新的ASP.Net Core 2.1 Angular应用程序。不幸的是,每次我尝试运行
webpack--config webpack.config.vendor.js
时,我都会收到

 TypeError: dep.getResourceIdentifier is not a function
    at addDependency (C:\Users\bdellinger\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:387:30)
    at iterationOfArrayCallback (C:\Users\bdellinger\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:78:3)
    at addDependenciesBlock (C:\Users\bdellinger\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:407:5)
    at Compilation.processModuleDependencies (C:\Users\bdellinger\AppData\Roaming\npm\node_modules\webpack\lib\Compilation.js:418:4) ...
这是我的package.json(我尝试了从2到4的许多不同版本的webpack,但总是得到相同的结果)


这与这个问题有关,我试图将font awesome添加到模板中

如果使用新的ASP.NET Core 2.1模板,则根本不需要运行webpack,因为它基于Angular cli,该cli在后台处理这些事情。 要使用字体,只需安装它们提供的角度组件。这是官方网站的链接

如果您不想使用该组件,也可以像这样在styles.css中导入:

@import url('https://use.fontawesome.com/releases/v5.1.0/css/all.css');
<i class="fas fa-stroopwafel"></i>
然后您可以像在普通HTML中一样使用它,如下所示:

@import url('https://use.fontawesome.com/releases/v5.1.0/css/all.css');
<i class="fas fa-stroopwafel"></i>


已对此进行了说明。

您确定使用的是最新的模板吗?因为如果使用ASP.NET Core 2.1模板创建了angular应用程序,则该应用程序中根本不应包含webpack.config文件。这与旧的ASP.NET core 1.1模板中的情况类似。感谢您,我现在得到了…拒绝加载映像,因为它违反了以下内容安全策略指令:“default src‘self’”。请注意,“img src”并没有显式设置,所以“default src”被用作回退。我不能在不了解您正在做什么的情况下谈论这一点。这似乎是一个浏览器安全问题。如果有帮助,请检查此项。