Munter / netlify-plugin-subfont

Netlify build plugin to run automated web font loading optimizations on static pages
BSD 3-Clause "New" or "Revised" License
66 stars 7 forks source link

Error `Cannot read property 'used' of undefined` #48

Open ehmicky opened 4 years ago

ehmicky commented 4 years ago

The following error happened in some builds:

 ⚠ WARN: inline JavaScript in dist/index.html - Parse error in inline JavaScript in dist/index.html
Unexpected token (1:805)
Including assets:
dist/index.html
 ⚠ WARN: inline JavaScript in dist/privacy/index.html - Parse error in inline JavaScript in dist/privacy/index.html
Unexpected token (1:256)
Including assets:
dist/privacy/index.html
 ⚠ WARN: inline JavaScript in dist/terms-of-use/index.html - Parse error in inline JavaScript in dist/terms-of-use/index.html
Unexpected token (1:256)
Including assets:
dist/terms-of-use/index.html
 ✔ 0.120 secs: compressJavaScript
 ✔ 0.022 secs: writeAssetsToDisc

┌────────────────────────────────────────┐
│ Plugin "netlify-plugin-subfont" failed │
└────────────────────────────────────────┘

Error message
Failed during font subsetting

### LOG: ###
verions: {
  "netlify-build": "1.0.10",
  "netlify-plugin-subfont": "5.0.2",
  "subfont": "5.0.1",
  "assetgraph": "6.0.7"
}

Plugin configuration: {
  "entryPoints": [
    "*.html"
  ],
  "recursive": true,
  "inlineFonts": false,
  "inlineCss": false,
  "fontDisplay": "swap",
  "fallbacks": true
}

Resolved entry points: [
  "/opt/build/repo/dist/200.html",
  "/opt/build/repo/dist/index.html"
]

Subfont called with: {
  "recursive": true,
  "inlineFonts": false,
  "inlineCss": false,
  "fontDisplay": "swap",
  "fallbacks": true,
  "inputFiles": [
    "/opt/build/repo/dist/200.html",
    "/opt/build/repo/dist/index.html"
  ],
  "root": "dist",
  "canonicalRoot": "https://hearsay.netlify.app",
  "inPlace": true
}

Cannot read property 'used' of undefined 
    /opt/buildhome/.netlify-build-plugins/node_modules/subfont/lib/subfont.js:264:30 subfont
    /opt/buildhome/.netlify-build-plugins/node_modules/netlify-plugin-subfont/lib/index.js:69:5 async onPostBuild
    src/plugins/child/run.js:18:3 async Object.run
    src/plugins/child/main.js:38:38 async handleEvent
    src/plugins/ipc.js:97:9 async process.<anonymous>

This is a private repository. Do you know what error might be?

ehmicky commented 4 years ago

Another instance:


10:28:30 AM: Build ready to start
10:28:32 AM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
10:28:32 AM: build-image tag: v3.4.1
10:28:32 AM: buildbot version: fcbc7a79f7372e5995cf02954ef19fc48d20c871
10:28:32 AM: Fetching cached dependencies
10:28:33 AM: Starting to download cache of 261.4MB
10:28:34 AM: Finished downloading cache in 1.147505236s
10:28:34 AM: Starting to extract cache
10:28:42 AM: Finished extracting cache in 8.495319712s
10:28:42 AM: Finished fetching cache in 9.708841741s
10:28:42 AM: Starting to prepare the repo for build
10:28:43 AM: Preparing Git Reference refs/heads/master
10:28:45 AM: Different build command detected, going to use the one specified in the Netlify configuration file: 'hugo --minify --gc --baseURL https://hassaanmv.com' versus '' in the Netlify UI
10:28:45 AM: Starting build script
10:28:45 AM: Installing dependencies
10:28:45 AM: Python version set to 2.7
10:28:46 AM: Started restoring cached node version
10:28:50 AM: Finished restoring cached node version
10:28:51 AM: v10.22.0 is already installed.
10:28:52 AM: Now using node v10.22.0 (npm v6.14.6)
10:28:52 AM: Started restoring cached build plugins
10:28:52 AM: Finished restoring cached build plugins
10:28:53 AM: Attempting ruby version 2.6.2, read from environment
10:28:54 AM: Using ruby version 2.6.2
10:28:54 AM: Using PHP version 5.6
10:28:54 AM: Installing pip dependencies
10:28:54 AM: Started restoring cached pip cache
10:28:54 AM: Finished restoring cached pip cache
10:28:58 AM: DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
10:28:59 AM: Collecting fonttools
10:28:59 AM:   Downloading fonttools-3.44.0-py2.py3-none-any.whl (728 kB)
10:28:59 AM: Collecting brotli
10:29:00 AM:   Downloading Brotli-1.0.7-cp27-cp27mu-manylinux1_x86_64.whl (352 kB)
10:29:00 AM: Collecting zopfli
10:29:00 AM:   Downloading zopfli-0.1.7-cp27-cp27mu-manylinux1_x86_64.whl (40 kB)
10:29:00 AM: Installing collected packages: fonttools, brotli, zopfli
10:29:01 AM: Successfully installed brotli-1.0.7 fonttools-3.44.0 zopfli-0.1.7
10:29:01 AM: WARNING: You are using pip version 20.2b1; however, version 20.2.2 is available.
10:29:01 AM: You should consider upgrading via the '/opt/buildhome/python2.7/bin/python2.7 -m pip install --upgrade pip' command.
10:29:01 AM: Pip dependencies installed
10:29:01 AM: 5.2 is already installed.
10:29:01 AM: Using Swift version 5.2
10:29:01 AM: Installing Hugo 0.74.3
10:29:02 AM: Hugo Static Site Generator v0.74.3-DA0437B4/extended linux/amd64 BuildDate: 2020-07-23T16:30:30Z
10:29:02 AM: Started restoring cached go cache
10:29:04 AM: Finished restoring cached go cache
10:29:04 AM: Installing Go version 1.12
10:29:04 AM: unset GOOS;
10:29:04 AM: unset GOARCH;
10:29:04 AM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64';
10:29:04 AM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.12.linux.amd64/bin:${PATH}";
10:29:04 AM: go version >&2;
10:29:04 AM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.12.linux.amd64.env';
10:29:04 AM: go version go1.12 linux/amd64
10:29:04 AM: Installing missing commands
10:29:04 AM: Verify run directory
10:29:05 AM: ​
10:29:05 AM: ┌─────────────────────────────┐
10:29:05 AM: │        Netlify Build        │
10:29:05 AM: └─────────────────────────────┘
10:29:05 AM: ​
10:29:05 AM: ❯ Version
10:29:05 AM:   @netlify/build 3.3.0
10:29:05 AM: ​
10:29:05 AM: ❯ Flags
10:29:05 AM:   deployId: 5f44cbae3581020007b392f0
10:29:05 AM:   mode: buildbot
10:29:05 AM: ​
10:29:05 AM: ❯ Current directory
10:29:05 AM:   /opt/build/repo
10:29:05 AM: ​
10:29:05 AM: ❯ Config file
10:29:05 AM:   /opt/build/repo/netlify.toml
10:29:05 AM: ​
10:29:05 AM: ❯ Context
10:29:05 AM:   production
10:29:05 AM: ​
10:29:05 AM: ❯ Loading plugins
10:29:05 AM:    - netlify-plugin-subfont@5.0.3 from netlify.toml
10:29:14 AM: ​
10:29:14 AM: ┌────────────────────────────────────┐
10:29:14 AM: │ 1. build.command from netlify.toml │
10:29:14 AM: └────────────────────────────────────┘
10:29:14 AM: ​
10:29:14 AM: $ hugo --minify --gc --baseURL https://hassaanmv.com
10:29:15 AM: Building sites …
10:29:15 AM:                    | DV
10:29:15 AM: -------------------+-----
10:29:15 AM:   Pages            | 90
10:29:15 AM:   Paginator pages  |  1
10:29:15 AM:   Non-page files   |  9
10:29:15 AM:   Static files     | 51
10:29:15 AM:   Processed images |  0
10:29:15 AM:   Aliases          | 25
10:29:15 AM:   Sitemaps         |  1
10:29:15 AM:   Cleaned          |  0
10:29:15 AM: Total in 386 ms
10:29:15 AM: ​
10:29:15 AM: (build.command completed in 468ms)
10:29:15 AM: ​
10:29:15 AM: ┌────────────────────────────────────────────────────┐
10:29:15 AM: │ 2. onPostBuild command from netlify-plugin-subfont │
10:29:15 AM: └────────────────────────────────────────────────────┘
10:29:15 AM: ​
10:29:15 AM: Running subfont version 5.0.7
10:29:15 AM:  ✔ 0.001 secs: logEvents
10:29:15 AM:  ✔ 0.363 secs: loadAssets
10:29:16 AM:  ⚠ WARN: ENOENT: no such file or directory, open 'public/font/KFGQPC-HAFS.woff2'
10:29:16 AM:  ⚠ WARN: ENOENT: no such file or directory, open 'public/font/KFGQPC-HAFS.woff'
10:29:16 AM:  ⚠ WARN: ENOENT: no such file or directory, open 'public/font/KFGQPC-HAFS.ttf'
10:29:20 AM:  ✔ 5.490 secs: populate
10:29:21 AM:  ✔ 0.259 secs: checkIncompatibleTypes
10:29:21 AM:  ✔ 0.088 secs: applySourceMaps
10:29:21 AM:  ✔ 0.295 secs: populate
10:30:13 AM:  ⚠ WARN: ENOENT: no such file or directory, open 'public/font/KFGQPC-HAFS.woff2'
10:30:13 AM:  ✔ 0.337 secs: populate
10:30:13 AM:  ⚠ WARN: public/font/KFGQPC-HAFS.woff2 - Not a TrueType or OpenType font
10:30:13 AM:          Including assets:
10:30:13 AM:              public/sass/main.css
10:30:13 AM:  ⚠ WARN: public/font/KFGQPC-HAFS.woff2 - Not a TrueType or OpenType font
10:30:13 AM:          Including assets:
10:30:13 AM:              public/sass/main.css
10:30:20 AM:  ℹ INFO: Missing glyph fallback detected.
10:30:20 AM:          When your primary webfont doesn't contain the glyphs you use, browsers that don't support unicode-range will load your fallback fonts, which will be a potential waste of bandwidth.
10:30:20 AM:          These glyphs are used on your site, but they don't exist in the font you applied to them:         - \u{2009} ( ) in font-family 'thaana' (normal/normal) at public/404.html (generated content)
10:30:20 AM:          - \u{2191} (↑) in font-family 'thaana' (normal/normal) at public/404.html:111:31
10:30:20 AM:          - \u{25bc} (▼) in font-family 'thaana' (normal/normal) at public/404.html (generated content)
10:30:20 AM:          - \u{61} (a) in font-family 'naskh' (normal/normal) at public/404.html:1:23
10:30:20 AM:          - \u{62} (b) in font-family 'naskh' (normal/normal) at public/404.html:1:72
[...]
10:30:54 AM:          - \u{2013} (–) in font-family 'symb' (normal/normal) at public/authors/ibn-abdilwahhab/index.html:111:29
10:30:54 AM:          - \u{25bc} (▼) in font-family 'symb' (normal/normal) at public/authors/ibn-abdilwahhab/index.html (generated content)
10:30:54 AM:  ✔ 0.195 secs: serializeSourceMaps
10:30:54 AM:  ✔ 1.679 secs: compressJavaScript
10:30:54 AM:  ✔ 0.106 secs: writeAssetsToDisc
10:30:54 AM: public/404.html: 3 fonts (3 variants) in use, 173 kB total. Created subsets: 80.7 kB total
10:30:54 AM:   naskh:
10:30:54 AM:     normal : 218/296 codepoints used, 56.8 kB (woff2) => 43.3 kB (woff2)
10:30:54 AM:   symb:
10:30:54 AM:     normal : 217/ 57 codepoints used, 70.3 kB (woff2) => 17 kB (woff2)
10:30:54 AM:   thaana:
10:30:54 AM:     normal : 217/526 codepoints used, 46.1 kB (woff2) => 20.5 kB (woff2)
10:30:54 AM: public/index.html: 3 fonts (3 variants) in use, 173 kB total. Created subsets: 80.7 kB total
10:30:54 AM:   naskh:
10:30:54 AM:     normal : 218/296 codepoints used, 56.8 kB (woff2) => 43.3 kB (woff2)
10:30:54 AM:   symb:
10:30:54 AM:     normal : 217/ 57 codepoints used, 70.3 kB (woff2) => 17 kB (woff2)
10:30:54 AM:   thaana:
10:30:54 AM:     normal : 217/526 codepoints used, 46.1 kB (woff2) => 20.5 kB (woff2)
10:30:54 AM: public/post/index.html: 3 fonts (3 variants) in use, 173 kB total. Created subsets: 80.7 kB total
10:30:54 AM:   naskh:
10:30:54 AM:     normal : 218/296 codepoints used, 56.8 kB (woff2) => 43.3 kB (woff2)
10:30:54 AM:   symb:
10:30:54 AM:     normal : 217/ 57 codepoints used, 70.3 kB (woff2) => 17 kB (woff2)
10:30:54 AM:   thaana:
10:30:54 AM:     normal : 217/526 codepoints used, 46.1 kB (woff2) => 20.5 kB (woff2)
10:30:54 AM: public/categories/index.html: 3 fonts (3 variants) in use, 173 kB total. Created subsets: 80.7 kB total
10:30:54 AM:   naskh:
10:30:54 AM:     normal : 218/296 codepoints used, 56.8 kB (woff2) => 43.3 kB (woff2)
10:30:54 AM:   symb:
10:30:54 AM:     normal : 217/ 57 codepoints used, 70.3 kB (woff2) => 17 kB (woff2)
10:30:54 AM:   thaana:
10:30:54 AM:     normal : 217/526 codepoints used, 46.1 kB (woff2) => 20.5 kB (woff2)
10:30:54 AM: public/tags/index.html: 3 fonts (3 variants) in use, 173 kB total. Created subsets: 80.7 kB total
10:30:54 AM:   naskh:
10:30:54 AM:     normal : 218/296 codepoints used, 56.8 kB (woff2) => 43.3 kB (woff2)
10:30:54 AM:   symb:
10:30:54 AM:     normal : 217/ 57 codepoints used, 70.3 kB (woff2) => 17 kB (woff2)
10:30:55 AM:   thaana:
10:30:55 AM:     normal : 217/526 codepoints used, 46.1 kB (woff2) => 20.5 kB (woff2)
10:30:55 AM: public/welcome/index.html: 3 fonts (3 variants) in use, 173 kB total. Created subsets: 80.7 kB total
10:30:55 AM:   naskh:
10:30:55 AM:     normal : 218/296 codepoints used, 56.8 kB (woff2) => 43.3 kB (woff2)
10:30:55 AM:   symb:
10:30:55 AM:     normal : 217/ 57 codepoints used, 70.3 kB (woff2) => 17 kB (woff2)
10:30:55 AM:   thaana:
10:30:55 AM:     normal : 217/526 codepoints used, 46.1 kB (woff2) => 20.5 kB (woff2)
10:30:55 AM: ​
10:30:55 AM: ┌────────────────────────────────────────┐
10:30:55 AM: │ Plugin "netlify-plugin-subfont" failed │
10:30:55 AM: └────────────────────────────────────────┘
10:30:55 AM: ​
10:30:55 AM:   Error message
10:30:55 AM:   TypeError: Failed during font subsetting
10:30:55 AM: ​
10:30:55 AM:   ### LOG: ###
10:30:55 AM:   verions: {
10:30:55 AM:     "netlify-build": "3.3.0",
10:30:55 AM:     "netlify-plugin-subfont": "5.0.3",
10:30:55 AM:     "subfont": "5.0.7",
10:30:55 AM:     "assetgraph": "6.1.1"
10:30:55 AM:   }
10:30:55 AM: ​
10:30:55 AM:   Plugin configuration: {
10:30:55 AM:     "entryPoints": [
10:30:55 AM:       "*.html"
10:30:55 AM:     ],
10:30:55 AM:     "recursive": true,
10:30:55 AM:     "inlineFonts": false,
10:30:55 AM:     "inlineCss": false,
10:30:55 AM:     "fontDisplay": "swap",
10:30:55 AM:     "fallbacks": true
10:30:55 AM:   }
10:30:55 AM: ​
10:30:55 AM:   Resolved entry points: [
10:30:55 AM:     "/opt/build/repo/public/404.html",
10:30:55 AM:     "/opt/build/repo/public/index.html"
10:30:55 AM:   ]
10:30:55 AM: ​
10:30:55 AM:   Subfont called with: {
10:30:55 AM:     "recursive": true,
10:30:55 AM:     "inlineFonts": false,
10:30:55 AM:     "inlineCss": false,
10:30:55 AM:     "fontDisplay": "swap",
10:30:55 AM:     "fallbacks": true,
10:30:55 AM:     "inputFiles": [
10:30:55 AM:       "/opt/build/repo/public/404.html",
10:30:55 AM:       "/opt/build/repo/public/index.html"
10:30:55 AM:     ],
10:30:55 AM:     "root": "public",
10:30:55 AM:     "canonicalRoot": "https://hassaanmv.com",
10:30:55 AM:     "inPlace": true
10:30:55 AM:   }
10:30:55 AM: ​
10:30:55 AM:   Cannot read property 'used' of undefined
10:30:55 AM: ​
10:30:55 AM:   Plugin details
10:30:55 AM:   Package:        netlify-plugin-subfont
10:30:55 AM:   Version:        5.0.3
10:30:55 AM:   Repository:     git://github.com/munter/netlify-plugin-subfont.git
10:30:55 AM:   npm link:       https://www.npmjs.com/package/netlify-plugin-subfont
10:30:55 AM:   Report issues:  https://github.com/munter/netlify-plugin-subfont/issues
10:30:55 AM: ​
10:30:55 AM:   Error location
10:30:55 AM:   In "onPostBuild" event in "netlify-plugin-subfont" from netlify.toml
10:30:55 AM:       at subfont (/opt/buildhome/.netlify-build-plugins/node_modules/subfont/lib/subfont.js:296:30)
10:30:55 AM:       at async onPostBuild (/opt/buildhome/.netlify-build-plugins/node_modules/netlify-plugin-subfont/lib/index.js:69:5)
10:30:55 AM: ​
10:30:55 AM:   Resolved config
10:30:55 AM:   build:
10:30:55 AM:     command: 'hugo --minify --gc --baseURL https://hassaanmv.com'
10:30:55 AM:     commandOrigin: config
10:30:55 AM:     environment:
10:30:55 AM:       - HUGO_VERSION
10:30:55 AM:       - HUGO_ENV
10:30:55 AM:       - HUGO_ENABLEGITINFO
10:30:55 AM:     publish: /opt/build/repo/public
10:30:55 AM:   headers:
10:30:55 AM:     - for: /images/*      values:        Cache-Control: 'public, s-max-age=604800'    - for: /*.css      values:        Cache-Control: 'public, s-max-age=604800'    - for: /*.js      values:        Cache-Control: 'public, s-max-age=604800'    - for: /lib/*      values:        Cache-Control: max-age=31536000  plugins:    - inputs:        fallbacks: true        inlineCss: false        inlineFonts: false        recursive: true      origin: config      package: netlify-plugin-subfont​┌─────────────────────────────┐│   Netlify Build Complete    │└─────────────────────────────┘​(Netlify Build completed in 1m 47.5s)Caching artifactsStarted saving build pluginsFinished saving build pluginsStarted saving pip cacheFinished saving pip cacheStarted saving emacs cask dependenciesFinished saving emacs cask dependenciesStarted saving maven dependenciesFinished saving maven dependenciesStarted saving boot dependenciesFinished saving boot dependenciesStarted saving go dependenciesFinished saving go dependencies
10:30:55 AM: Build script success
10:30:55 AM: Starting to deploy site from 'public'
10:30:55 AM: Creating deploy tree 
10:30:55 AM: 62 new files to upload
10:30:55 AM: 0 new functions to upload
10:30:59 AM: Minifying css bundle
10:31:03 AM: Minifying css bundle
10:31:05 AM: Post processing - header rules
10:31:05 AM: Post processing - redirect rules
10:31:05 AM: Post processing done
10:31:05 AM: Site is live
10:31:39 AM: Finished processing build request in 3m6.723665329s
``