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 'filename' of undefined #34

Open
Fi1osof opened this issue Mar 4, 2020 · 3 comments
Open

Cannot read property 'filename' of undefined #34

Fi1osof opened this issue Mar 4, 2020 · 3 comments

Comments

@Fi1osof
Copy link

Fi1osof commented Mar 4, 2020

prometheus-api-metrics/src/index.js:5:73

node started with --experimental-modules, there no module object. Path.dirname(module.parent.filename)

Maybe use dir: process.cwd() instead?

@carlossuds
Copy link

I'm having the sabe problem. DId you find any solution?

@Fi1osof
Copy link
Author

Fi1osof commented Feb 23, 2021

@carlossuds, sorry, no. I do not use this any more.

@alucryd
Copy link

alucryd commented Apr 21, 2022

Still a thing unfortunately, not well-versed enough in JS yet, but if I find something I'll make a PR. In the meantime, express-prometheus-middleware works for me, so you can use that on instead.

Edit: You can use this trick https://dev.to/jimthedev/typeerror-cannot-read-property-filename-of-undefined-in-es-modules-in-node-14-and-greater-6ia

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

3 participants