Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vuecli5 the static resource CSS prompt under public cannot find the module #6890

Open
ht-sauce opened this issue Dec 21, 2021 · 2 comments
Open

Comments

@ht-sauce
Copy link

ht-sauce commented Dec 21, 2021

Version

5.0.0-rc.1

Environment info

vuecli5

Steps to reproduce

@font-face {
font-family: 'SY-Bold';
src: url('/nbs-pc/comfonts/SourceHanSansCN-Bold.otf');
}
@font-face {
font-family: 'SY-Regular';
src: url('/nbs-pc/comfonts/SourceHanSansCN-Regular.ttf');
}
@font-face {
font-family: 'SY-Heavy';
src: url('/nbs-pc/comfonts/SourceHanSerifCN-Heavy-4.otf');
}
In the original project, this will not report an error. Now it is prompted that the module cannot be found

What is expected?

Ignore this part of the URL address

What is actually happening?

Module not found

@ht-sauce ht-sauce changed the title 在public下面的静态资源css提示找不到模块 Vuecli5 the static resource CSS prompt under public cannot find the module Dec 21, 2021
@towertop
Copy link

That is due to css-loader 4.0.0 breaking changes recorded at CHANGELOG.md# . It will try to resolve absolute urls now.

Look this thread issues/1153 too. In vue-cli context, you can reference to public assets with additional prefix like url('/public/img/.../a.png') .

@ht-sauce
Copy link
Author

That is due to css-loader 4.0.0 breaking changes recorded at CHANGELOG.md# . It will try to resolve absolute urls now.

Look this thread issues/1153 too. In vue-cli context, you can reference to public assets with additional prefix like url('/public/img/.../a.png') .
Thank you. I used an alternative

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants