path-browserify icon indicating copy to clipboard operation
path-browserify copied to clipboard

TypeError: process.cwd is not a function

Open yoloz opened this issue 2 years ago • 3 comments

vue3 + vite

import { resolve } from 'path-browserify'
resolve(basePath, childpath)
index.js:124  Uncaught (in promise) TypeError: process.cwd is not a function
    at resolve (index.js:124:25)
   ......

yoloz avatar Jun 30 '23 01:06 yoloz

https://github.com/browserify/path-browserify/issues/29#issuecomment-1600002373 inject process, but browser err:

Uncaught SyntaxError: The requested module '/@fs/xxx/node_modules/.pnpm/[email protected]/node_modules/process/browser.js?v=0ada4f31' does not provide an export named 'default'

yoloz avatar Jun 30 '23 02:06 yoloz

vue3 + vite

import { resolve } from 'path-browserify'
resolve(basePath, childpath)
index.js:124  Uncaught (in promise) TypeError: process.cwd is not a function
    at resolve (index.js:124:25)
   ......

you can see me issue, resolved

https://github.com/browserify/path-browserify/issues/34

LuoRiWuSheng avatar Aug 30 '23 09:08 LuoRiWuSheng

vue3 + vite

import { resolve } from 'path-browserify'
resolve(basePath, childpath)
index.js:124  Uncaught (in promise) TypeError: process.cwd is not a function
    at resolve (index.js:124:25)
   ......

you can see me issue, resolved

#34

yeah, i had write a function too, this question want path-browserify support, thanks.

yoloz avatar Aug 30 '23 10:08 yoloz