Notice: The Monaca & Onsen UI Community Forum is shutting down.
For Onsen UI bug reports, feature requests and questions, please use the Onsen UI GitHub issues page. For help with Monaca, please contact Monaca Support Team.
Thank you to all our community for your contributions to the forum. We look forward to hearing from you in the new communication channels.
Problem requesting fonts in OnsenUI/vue-cordova-webpack template
denious last edited by denious
I am trying out the OnsenUI/vue-cordova-webpack template template and am running into an issue serving font files.
Below you can see that the files are served properly, but requested with an incorrectly appended /static/css appended to the path.
I understand why the requests are made that way, see 3rd screenshot, but don’t know how to fix it?
@denious Hi! Thanks a lot for reporting. I assume this is during development, right?
Check this line and try to play a little bit with it, perhaps adding
'/'at the very end instead of
''. It worked during my development test but I’ll check again.
If you wonder why it is different for development and production, well, Cordova uses
file://some/path/www/...for serving files so we cannot use absolute paths, it must be relative.
I’ve tested it again both in development (
npm run dev) and production (
npm run buildand then manually serving the resulting
wwwdirectory) and both work well.
[Tue Jun 27 2017 09:16:07 GMT+0900 (JST)] "GET /static/fonts/ionicons.dd4781d.ttf" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36"
denious last edited by
Thanks a lot for your quick response, your first suggestion fixes the problem! :+1:
@denious Good to read that. I think
'/'should be more robust for development so I just updated it :+1: