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 in browser: process is not defined #29

Open
tanishqkancharla opened this issue Oct 28, 2022 · 5 comments · May be fixed by #36
Open

Error in browser: process is not defined #29

tanishqkancharla opened this issue Oct 28, 2022 · 5 comments · May be fixed by #36

Comments

@tanishqkancharla
Copy link

When calling `path.resolve("tmp", ".."), this branch is triggered, causing an error in the browser (line 124 in index.js):

if (cwd === undefined)
  cwd = process.cwd();
path = cwd;
Uncaught ReferenceError: process is not defined

I think this error should be caught.

@kolserdav
Copy link

kolserdav commented Jan 19, 2023

+1

@kolserdav
Copy link

The problem was solved when I used join instead of resolve.

@UniqueCrownClown
Copy link

1

@mmacchao
Copy link

安装process

yarn add process -S

vite.config.ts中配置注入process

安装@rollup/plugin-inject

yarn add @rollup/plugin-inject -D

plugins里面加入

import inject from '@rollup/plugin-inject'
inject({
  process: 'process/browser'
})

@LuoRiWuSheng
Copy link

LuoRiWuSheng commented Aug 30, 2023

我的那个 is

When calling `path.resolve("tmp", ".."), this branch is triggered, causing an error in the browser (line 124 in index.js):

if (cwd === undefined)
  cwd = process.cwd();
path = cwd;
Uncaught ReferenceError: process is not defined

I think this error should be caught.

我的那个issue 已经解决了 , 可以去看看

When calling `path.resolve("tmp", ".."), this branch is triggered, causing an error in the browser (line 124 in index.js):

if (cwd === undefined)
  cwd = process.cwd();
path = cwd;
Uncaught ReferenceError: process is not defined

I think this error should be caught.

我的那个issue 已经解决了,可以去看看

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

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

Successfully merging a pull request may close this issue.

5 participants