Node Error: resolve-url-loader: CSS error
Node Error: resolve-url-loader: CSS error
我正在尝试 运行 在我的表面上将一个反应项目作为开发服务器,如果给我下面和标题中显示的错误。当我 运行 在我的电脑上使用相同的配置时,我没有遇到这个问题。 (我尝试创建相同的条件,但它就是行不通)。
错误:
./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-5-3!./node_modules/sass-loader/lib/loader.js??ref--6-oneOf-5-4!./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0)
Error: resolve-url-loader: CSS error
source-map information is not available at url() declaration (found orphan CR, try removeCR option)
来自浏览器控制台的完整错误:(Chrome)
Fetch API cannot load file:///C:/Users/Max-T/Documents/Sources/StaffMangerV2/Oauth2Manager-Web/src/assets/scss/black-dashboard-pro-react.scss. URL scheme must be "http" or "https" for CORS request.
(anonymous) @ index.js:1679
s @ index.js:499
(anonymous) @ index.js:479
e.<computed> @ index.js:536
S @ index.js:1517
i @ index.js:1534
(anonymous) @ index.js:1541
(anonymous) @ index.js:1530
(anonymous) @ index.js:1699
(anonymous) @ index.js:1673
s @ index.js:499
(anonymous) @ index.js:479
e.<computed> @ index.js:536
S @ index.js:1517
i @ index.js:1534
(anonymous) @ index.js:1541
(anonymous) @ index.js:1530
q @ index.js:1726
I @ index.js:1658
G @ index.js:1817
(anonymous) @ index.js:1831
(anonymous) @ index.js:1848
(anonymous) @ index.js:1332
error (async)
u @ index.js:1334
K @ index.js:1847
ce @ index.js:1951
./node_modules/react-dev-utils/webpackHotDevClient.js @ webpackHotDevClient.js:38
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
0 @ store.js:18
__webpack_require__ @ bootstrap:785
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
index.js:1679 Fetch API cannot load file:///C:/Users/Max-T/Documents/Sources/StaffMangerV2/Oauth2Manager-Web/node_modules/resolve-url-loader/index.js. URL scheme must be "http" or "https" for CORS request.
(anonymous) @ index.js:1679
s @ index.js:499
(anonymous) @ index.js:479
e.<computed> @ index.js:536
S @ index.js:1517
i @ index.js:1534
(anonymous) @ index.js:1541
(anonymous) @ index.js:1530
(anonymous) @ index.js:1699
(anonymous) @ index.js:1673
s @ index.js:499
(anonymous) @ index.js:479
e.<computed> @ index.js:536
S @ index.js:1517
i @ index.js:1534
(anonymous) @ index.js:1541
(anonymous) @ index.js:1530
q @ index.js:1726
I @ index.js:1658
G @ index.js:1817
(anonymous) @ index.js:1831
(anonymous) @ index.js:1848
(anonymous) @ index.js:1332
error (async)
u @ index.js:1334
K @ index.js:1847
ce @ index.js:1951
./node_modules/react-dev-utils/webpackHotDevClient.js @ webpackHotDevClient.js:38
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
0 @ store.js:18
__webpack_require__ @ bootstrap:785
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
main.chunk.js:10 Uncaught Error: Module build failed (from ./node_modules/resolve-url-loader/index.js):
Error: resolve-url-loader: CSS error
source-map information is not available at url() declaration (found orphan CR, try removeCR option)
at file://C:\Users\Max-T\Documents\Sources\StaffMangerV2\Oauth2Manager-Web\src\assets\scss\black-dashboard-pro-react.scss:13239:3
at encodeError (C:\Users\Max-T\Documents\Sources\StaffMangerV2\Oauth2Manager-Web\node_modules\resolve-url-loader\index.js:219:12)
at onFailure (C:\Users\Max-T\Documents\Sources\StaffMangerV2\Oauth2Manager-Web\node_modules\resolve-url-loader\index.js:176:14)
at Object../node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/resolve-url-loader/index.js?!./node_modules/sass-loader/lib/loader.js?!./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 (http://localhost:3000/static/js/main.chunk.js:10:7)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:786:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Object../src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 (http://localhost:3000/static/js/main.chunk.js:744:15)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:786:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Module../src/index.js (http://localhost:3000/static/js/main.chunk.js:9220:109)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:786:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Object.0 (http://localhost:3000/static/js/main.chunk.js:9988:18)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:786:30)
at checkDeferredModules (http://localhost:3000/static/js/bundle.js:46:23)
at Array.webpackJsonpCallback [as push] (http://localhost:3000/static/js/bundle.js:33:19)
at http://localhost:3000/static/js/main.chunk.js:1:85
./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/resolve-url-loader/index.js?!./node_modules/sass-loader/lib/loader.js?!./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 @ main.chunk.js:10
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 @ black-dashboard-pro-react.scss?v=1.0.0:1
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
./src/index.js @ index.css?e32c:37
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
0 @ store.js:18
__webpack_require__ @ bootstrap:785
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
index.js:1375 ./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-5-3!./node_modules/sass-loader/lib/loader.js??ref--6-oneOf-5-4!./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0)
Error: resolve-url-loader: CSS error
source-map information is not available at url() declaration (found orphan CR, try removeCR option)
我有同样的错误。要解决此问题,我必须导航至
node_modules/resolve-url-loader
打开
index.js
并在 var options
下将 removeCR
从 "false" 更改为 "true"。
嗯,这个解决方案一定是跟一些包配置什么的有关。但我想分享我应用的解决方案:
@import "variables";
@import "colored-balls";
@import "glowing-ball";
@import "pixel-loader";
@import "square-box";
@import "circle-loader";
@import "jumping-dots-loader";
查找负责模块无法解析的文件(查找错误文件)。使用 ctrl + click ... 并一一评论,直到你看到其中哪些你没有阅读,当你找到它们时:你可以,评论,或者 删除。它们是预加载器,我不需要它们。
/* @import "colored-balls"; */
/* @import "pixel-loader"; */
另一种选择是为行尾序列类型配置 IDE 或编辑器,从 CRLF 更改为 LF ...它们只是替代方案...尝试一下。
签出 git 回购协议:
[core]
autocrlf = false
因为 Windows CRLF 不受 resolve-url-loader 支持,使用 node-sass 但选项不适用于 Create-React-App 设置。参见 https://github.com/sass/node-sass/issues/2756
就我而言,我最近将 Node.js 更新到最新版本并且未重建某些项目的依赖项。因此,我删除了现有的依赖项并重新构建了它们。然后错误消失了。
rm -rf node_modules
npm install
我正在尝试 运行 在我的表面上将一个反应项目作为开发服务器,如果给我下面和标题中显示的错误。当我 运行 在我的电脑上使用相同的配置时,我没有遇到这个问题。 (我尝试创建相同的条件,但它就是行不通)。
错误:
./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-5-3!./node_modules/sass-loader/lib/loader.js??ref--6-oneOf-5-4!./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0)
Error: resolve-url-loader: CSS error
source-map information is not available at url() declaration (found orphan CR, try removeCR option)
来自浏览器控制台的完整错误:(Chrome)
Fetch API cannot load file:///C:/Users/Max-T/Documents/Sources/StaffMangerV2/Oauth2Manager-Web/src/assets/scss/black-dashboard-pro-react.scss. URL scheme must be "http" or "https" for CORS request.
(anonymous) @ index.js:1679
s @ index.js:499
(anonymous) @ index.js:479
e.<computed> @ index.js:536
S @ index.js:1517
i @ index.js:1534
(anonymous) @ index.js:1541
(anonymous) @ index.js:1530
(anonymous) @ index.js:1699
(anonymous) @ index.js:1673
s @ index.js:499
(anonymous) @ index.js:479
e.<computed> @ index.js:536
S @ index.js:1517
i @ index.js:1534
(anonymous) @ index.js:1541
(anonymous) @ index.js:1530
q @ index.js:1726
I @ index.js:1658
G @ index.js:1817
(anonymous) @ index.js:1831
(anonymous) @ index.js:1848
(anonymous) @ index.js:1332
error (async)
u @ index.js:1334
K @ index.js:1847
ce @ index.js:1951
./node_modules/react-dev-utils/webpackHotDevClient.js @ webpackHotDevClient.js:38
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
0 @ store.js:18
__webpack_require__ @ bootstrap:785
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
index.js:1679 Fetch API cannot load file:///C:/Users/Max-T/Documents/Sources/StaffMangerV2/Oauth2Manager-Web/node_modules/resolve-url-loader/index.js. URL scheme must be "http" or "https" for CORS request.
(anonymous) @ index.js:1679
s @ index.js:499
(anonymous) @ index.js:479
e.<computed> @ index.js:536
S @ index.js:1517
i @ index.js:1534
(anonymous) @ index.js:1541
(anonymous) @ index.js:1530
(anonymous) @ index.js:1699
(anonymous) @ index.js:1673
s @ index.js:499
(anonymous) @ index.js:479
e.<computed> @ index.js:536
S @ index.js:1517
i @ index.js:1534
(anonymous) @ index.js:1541
(anonymous) @ index.js:1530
q @ index.js:1726
I @ index.js:1658
G @ index.js:1817
(anonymous) @ index.js:1831
(anonymous) @ index.js:1848
(anonymous) @ index.js:1332
error (async)
u @ index.js:1334
K @ index.js:1847
ce @ index.js:1951
./node_modules/react-dev-utils/webpackHotDevClient.js @ webpackHotDevClient.js:38
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
0 @ store.js:18
__webpack_require__ @ bootstrap:785
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
main.chunk.js:10 Uncaught Error: Module build failed (from ./node_modules/resolve-url-loader/index.js):
Error: resolve-url-loader: CSS error
source-map information is not available at url() declaration (found orphan CR, try removeCR option)
at file://C:\Users\Max-T\Documents\Sources\StaffMangerV2\Oauth2Manager-Web\src\assets\scss\black-dashboard-pro-react.scss:13239:3
at encodeError (C:\Users\Max-T\Documents\Sources\StaffMangerV2\Oauth2Manager-Web\node_modules\resolve-url-loader\index.js:219:12)
at onFailure (C:\Users\Max-T\Documents\Sources\StaffMangerV2\Oauth2Manager-Web\node_modules\resolve-url-loader\index.js:176:14)
at Object../node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/resolve-url-loader/index.js?!./node_modules/sass-loader/lib/loader.js?!./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 (http://localhost:3000/static/js/main.chunk.js:10:7)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:786:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Object../src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 (http://localhost:3000/static/js/main.chunk.js:744:15)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:786:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Module../src/index.js (http://localhost:3000/static/js/main.chunk.js:9220:109)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:786:30)
at fn (http://localhost:3000/static/js/bundle.js:151:20)
at Object.0 (http://localhost:3000/static/js/main.chunk.js:9988:18)
at __webpack_require__ (http://localhost:3000/static/js/bundle.js:786:30)
at checkDeferredModules (http://localhost:3000/static/js/bundle.js:46:23)
at Array.webpackJsonpCallback [as push] (http://localhost:3000/static/js/bundle.js:33:19)
at http://localhost:3000/static/js/main.chunk.js:1:85
./node_modules/css-loader/dist/cjs.js?!./node_modules/postcss-loader/src/index.js?!./node_modules/resolve-url-loader/index.js?!./node_modules/sass-loader/lib/loader.js?!./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 @ main.chunk.js:10
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 @ black-dashboard-pro-react.scss?v=1.0.0:1
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
./src/index.js @ index.css?e32c:37
__webpack_require__ @ bootstrap:785
fn @ bootstrap:150
0 @ store.js:18
__webpack_require__ @ bootstrap:785
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.chunk.js:1
index.js:1375 ./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0 (./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/resolve-url-loader??ref--6-oneOf-5-3!./node_modules/sass-loader/lib/loader.js??ref--6-oneOf-5-4!./src/assets/scss/black-dashboard-pro-react.scss?v=1.0.0)
Error: resolve-url-loader: CSS error
source-map information is not available at url() declaration (found orphan CR, try removeCR option)
我有同样的错误。要解决此问题,我必须导航至
node_modules/resolve-url-loader
打开
index.js
并在 var options
下将 removeCR
从 "false" 更改为 "true"。
嗯,这个解决方案一定是跟一些包配置什么的有关。但我想分享我应用的解决方案:
@import "variables";
@import "colored-balls";
@import "glowing-ball";
@import "pixel-loader";
@import "square-box";
@import "circle-loader";
@import "jumping-dots-loader";
查找负责模块无法解析的文件(查找错误文件)。使用 ctrl + click ... 并一一评论,直到你看到其中哪些你没有阅读,当你找到它们时:你可以,评论,或者 删除。它们是预加载器,我不需要它们。
/* @import "colored-balls"; */
/* @import "pixel-loader"; */
另一种选择是为行尾序列类型配置 IDE 或编辑器,从 CRLF 更改为 LF ...它们只是替代方案...尝试一下。
签出 git 回购协议:
[core]
autocrlf = false
因为 Windows CRLF 不受 resolve-url-loader 支持,使用 node-sass 但选项不适用于 Create-React-App 设置。参见 https://github.com/sass/node-sass/issues/2756
就我而言,我最近将 Node.js 更新到最新版本并且未重建某些项目的依赖项。因此,我删除了现有的依赖项并重新构建了它们。然后错误消失了。
rm -rf node_modules
npm install