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

Error with vitest #120

Open
AlexXi19 opened this issue Dec 28, 2023 · 1 comment
Open

Error with vitest #120

AlexXi19 opened this issue Dec 28, 2023 · 1 comment

Comments

@AlexXi19
Copy link

TypeError: Cannot read properties of undefined (reading 'filename')
 ❯ Object.<anonymous> ../../node_modules/.pnpm/[email protected][email protected]/node_modules/prometheus-api-metrics/src/index.js:5:73

Running into error with vitest.

@KuzinVadym
Copy link

KuzinVadym commented May 23, 2024

Has anyone else run into this problem? It happened in my code when I try to serve the nx application. Any chance that we can switch from
require('pkginfo')(metricsMiddleware, { dir: Path.dirname(module.parent.filename), include: ['name', 'version'] });
to
require('pkginfo')(metricsMiddleware, { dir: Path.dirname(module.parent ? module.parent.filename : module.filename ), include: ['name', 'version'] });
?

I kind of 99% sure that this is somehow related to nx deamon because after building static and run it with node - everything working perfectly.

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

No branches or pull requests

2 participants