Skip to content

TypeError: webfont is not a function #618

@ptiry02

Description

@ptiry02

I'm trying to use your library for my project, but when I try to execute the file I get the error saying webfont is not a function, can you help me?

import webfont from 'webfont';

webfont({
  files: 'src/assets/icons/**/*.svg',
  fontName: 'my-icons',
  dest: 'src/assets/webfont-icons-test',
})
  .then((result) => {
    console.log('Result: ', result);
    return result;
  })
  .catch((error) => {
    console.log('There has been an error:\n', error);
  });
> node devops/scripts/generate-icon-font.js

file:///[...]/devops/scripts/generate-icon-font.js:5
  webfont({
  ^

TypeError: webfont is not a function
    at file:///[...]/devops/scripts/generate-icon-font.js:5:3
    at ModuleJob.run (node:internal/modules/esm/module_job:194:25)

Node.js v18.17.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions