To reproduce the issue, I have created this test project
using two custom fonts and a CSS file called phone.css located in the application root directory (app
folder). However, with these settings the bundling is successful, and the projects run as expected (fonts and styles are applied).
Here are the steps -taken
- created fonts folder
with the custom fonts
- created phone.css
with the custom styles
- using the custom styles with relative path here
and applying the styles here
(note that you still need module.id
to resolve the relative path in the component file)
- installing WebPack plugin
npm i nativescript-dev-webpack --save-dev
- bundling the app
The project is built and started on a device and the custom fonts and styles are applied as expected.
Please provide more information about how you are working with phone.css
(the file in the error log).
If that file is created runtime make sure that you have included it in your webpack.config.js
as described in this article section
about adding extra assets. Another possible thing you might consider if the CSS file is created runtime is to use the documents
folder instead of the currentApp
folder on iOS as discussed here
If none of the above suggestions are valid for your scenario, pelase send us more detailed information about your specific project settings (full error log, package.json
and information about how phone.css
is used in your project ). If sending the original project is not an option, perhaps you can try isolating the issue using your custom fonts and CSS files in a separate new test project.