codeAdrian / gatsby-omni-font-loader

Font loader optimized for maximum performance. Removes render-blocking font resources and loads them asynchronusly. Handle FOUT & FOUC with font loading status watcher. Supports both local-hosted fonts and web fonts.
MIT License
106 stars 7 forks source link

gatsby-browser.js causes issue in mono-repo #12

Closed CodySchaaf closed 3 years ago

CodySchaaf commented 3 years ago

I'm working on adding this plugin to a theme which gatsby does by using yarn mono-repos. This causes the build to fail with

success createPages - 9.226s
success Checking for changed pages - 0.001s
success createPagesStatefully - 0.090s
success update schema - 0.294s
success write out redirect data - 0.002s
success Build manifest and related icons - 0.124s
success onPostBootstrap - 0.130s
info bootstrap finished - 17.981s
success onPreExtractQueries - 0.001s
success extract queries from components - 1.010s
success write out requires - 0.131s
success run static queries - 0.084s - 11/11 131.66/s
success run page queries - 0.044s - 2/2 45.00/s

 ERROR #98123  WEBPACK

Generating development JavaScript bundle failed

Unexpected token (31:4)

File: ../node_modules/gatsby-omni-font-loader/gatsby-browser.js:31:4

failed Building development bundle - 22.474s

Seems like there is a known fix for this following this example https://github.com/gatsbyjs/gatsby/issues/19042#issuecomment-557785506

CodySchaaf commented 3 years ago

I may have jumped the gun here. While trying to create a repo for you I think I fixed my current issue. I had it in the wrong package.json file (root instead of theme's sub package.json file). We probably can close for now. Will report back if there are any additional issues.

codeAdrian commented 3 years ago

Hi @CodySchaaf , thanks for reporting the issue and keeping me posted. Glad you've managed to find the fix in the meantime. Please let me know if the issue is not resolved and I'll have a look.