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

Unhandled Rejection (TypeError): path.parse is not a function #58

Closed
bharathkv6 opened this issue Dec 21, 2021 · 1 comment
Closed

Unhandled Rejection (TypeError): path.parse is not a function #58

bharathkv6 opened this issue Dec 21, 2021 · 1 comment

Comments

@bharathkv6
Copy link

import find from 'find-up';
import dotenv from 'dotenv';

const envPath = find.sync('.env');
dotenv.config({ path: envPath });

console.log(process.env);

I am trying to find the path of the .env file that is present in the root workspace (using yarn for creating workspace). I am using the above code in a library. When the application runs I am getting

Unhandled Rejection (TypeError): path.parse is not a function

Please help me fix this error.

@sindresorhus
Copy link
Owner

Submit a pull request with a failing test and I'll take a closer look. I'm requesting this as most issues like these are just users using the module incorrectly or an unrelated problem.

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