Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: webfont is not a function #618

Open
ptiry02 opened this issue Aug 17, 2023 · 1 comment
Open

TypeError: webfont is not a function #618

ptiry02 opened this issue Aug 17, 2023 · 1 comment

Comments

@ptiry02
Copy link

ptiry02 commented Aug 17, 2023

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
@ptiry02
Copy link
Author

ptiry02 commented Aug 17, 2023

nevermind, I fixed it! You should probably change the readme file to put:

import { webfont } from 'webfont';

instead of:

import webfont from 'webfont';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant