我使用的是vue cli 3,我有这种风格:
.login-page { ... background: url("~@/assets/login-bg.jpg") no-repeat; background-size: cover; background-position: center; ... }
当我跑的时候 yarn serve 我得到了这个错误:
yarn serve
/src/assets/login bg。jpg模块构建失败(从 ./node_模块/url加载程序/索引。js):类型错误[ERR_INVALID_ARG_TYPE]: “id”参数必须是string类型。接收类型对象 在模块上。要求(内部/模块/cjs/loader.js:630-11) 需要时(internal/modules/cjs/helpers.js:20:18) 反对。单元导出(C:\aquaprojects\src\bitbucket.org\scalock\server\tmui\node\u modules\url loader\index.js:35:24)
加载SVG没有问题,我缺少什么?
不知道为什么,但我删除了我的node_模块并重新安装,它可以正常工作