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

Cannot read property 'dirname' of undefined #496

Open
Aine06 opened this issue Aug 24, 2021 · 2 comments
Open

Cannot read property 'dirname' of undefined #496

Aine06 opened this issue Aug 24, 2021 · 2 comments

Comments

@Aine06
Copy link

Aine06 commented Aug 24, 2021

import { webfont } from "webfont";
"devDependencies":
{ "webfont": "^11.2.26"
},

@Aine06
Copy link
Author

Aine06 commented Aug 24, 2021

import webfont from "webfont";

webfont({
files: "http:/xxx/xxx.ttf",
fontName: "my-font-name",
})
.then((result) => {
// Do something with result
Function.prototype(result);
// Or return it
return result;
})
.catch((error) => {
throw error;
});

Something went wrong load component failed TypeError: Cannot read property 'dirname' of undefined at Object../node_modules/webfont/node_modules/glob-parent/index.js (index.js:4)

@jimmyandrade
Copy link
Collaborator

@Aine06 could you describe the bug better, with a clear and concise description of what the bug is?

It would be great if you could add steps to reproduce the behavior and a clear and concise description of what you expected to happen. If applicable, add logs or screenshots to help explain your problem.

Also, please complete the following information:

  • OS (e.g. macOS):
  • OS Version (e.g. 10.15.7):
  • Node Version (e.g. v12.17.0):
  • Webpack version, if applicable (e.g. 4.43.0):

And, if possible, please paste your project's package.json.

Thanks


You could also try:

  • Search for other issues in this repository and none addresses my problem;
  • Make a clean install (deleting node_modules dir, package-lock.json or yarn.lock file and installing again);
  • Use a version of Node.js equal to or greater than 12 (we recently removed support for Node.js versions 10 and below);
  • Try to reproduce this issue with last version of webpack, if your project uses webpack directly.

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

2 participants