Skip to content

TypeError: content.match is not a function #53

@Abdull

Description

@Abdull

Using

npm: 8.4.0
webpack: 5.52.1
fontmin-webpack: 3.2.0

I set up FontminPlugin in my webpack project as per its documentation (following reduced to minimal setup):

const FontminPlugin = require('fontmin-webpack');

module.exports = {
  entry: 'my-entry.js',
  output: {
    // ...
  },
  plugins: [
    // ...
    new FontminPlugin({
      autodetect: true
    })
  ],
}

I get the following TypeError when running my webpack build:

$ npm run build

> myproject@1.0.0 build
> webpack

myproject/node_modules/fontmin-webpack/lib/index.js:117
        const matches = content.match(GLYPH_REGEX) || []
                                ^

TypeError: content.match is not a function
    at myproject/node_modules/fontmin-webpack/lib/index.js:117:33
    at arrayMap (myproject/node_modules/lodash/lodash.js:653:23)
    at Function.map (myproject/node_modules/lodash/lodash.js:9622:14)
    at interceptor (myproject/node_modules/lodash/lodash.js:17094:35)
    at Function.thru (myproject/node_modules/lodash/lodash.js:8859:14)
    at myproject/node_modules/lodash/lodash.js:4430:28
    at arrayReduce (myproject/node_modules/lodash/lodash.js:697:21)
    at baseWrapperValue (myproject/node_modules/lodash/lodash.js:4429:14)
    at LodashWrapper.wrapperValue (myproject/node_modules/lodash/lodash.js:9114:14)
    at FontminPlugin.findUnicodeGlyphs (myproject/node_modules/fontmin-webpack/lib/index.js:138:8)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions