unjs / pathe

🛣️ Drop-in replacement of the Node.js's path module module that ensures paths are normalized

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`TypeError: process.cwd is not a function (it is undefined)` on React Native

kraenhansen opened this issue · comments

Environment

pathe on React Native

Reproduction

  • Create a new React Native app.
  • Import pathe
  • Call pathe.resolve("/").

Describe the bug

Some runtimes (like React Native) has a process global, but doesn't provide a cwd function, this results in a runtime error when importing the package from a React Native project.

Additional context

No response

Logs

TypeError: process.cwd is not a function (it is undefined)