Fix "Module not found" error by disabling font inlining in Angular build #93
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes the "Module not found" error that occurs when running
npm startin environments without internet access.Problem
The Angular build process was failing during the font inlining step when trying to retrieve Google Fonts from
https://fonts.googleapis.com/css?family=Roboto:300,400,500. This caused the build to fail with:Solution
Added a configuration option to disable font optimization in the Angular production build configuration:
{ "optimization": { "fonts": false } }This prevents the build process from attempting to inline external fonts during compilation, allowing the build to complete successfully in environments without internet access. The fonts will still be loaded at runtime when internet access is available.
Testing
npm installcompletes successfullynpm startnow works without errorsThe fix is minimal and surgical, affecting only the font optimization behavior during build time without impacting the application's functionality.
Fixes #92.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
fonts.googleapis.comng build angular-web-bluetooth-starter --configuration production(dns block)ng build angular-web-bluetooth-starter --configuration production(dns block)www.google-analytics.comng build @manekinekko/angular-web-bluetooth --configuration production(dns block)ng build angular-web-bluetooth-starter --configuration production(dns block)ng serve(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.