Skip to content

Commit

Permalink
merge: #3139
Browse files Browse the repository at this point in the history
3139: fix(web) shim node util for browserified version r=theoephraim a=theoephraim



Co-authored-by: Theo Ephraim <[email protected]>
  • Loading branch information
si-bors-ng[bot] and Theo Ephraim authored Jan 11, 2024
2 parents ce133b8 + 40f4eba commit 7628f8d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
1 change: 1 addition & 0 deletions app/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"reconnecting-websocket": "^4.4.0",
"tinycolor2": "^1.4.2",
"typescript": "^4.9.5",
"util-browser": "^0.0.2",
"validator": "^13.7.0",
"vanilla-picker": "^2.12.1",
"vue": "^3.3.12",
Expand Down
8 changes: 0 additions & 8 deletions app/web/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ import store from "./store";
// this is for joi - because we are importing the source rather than the default build made for the browser
globalThis.Buffer = Buffer;

// resolving an issue only seen on one user's machine... could not figure out why
// basically joi is using util - which references process.env... here we just creat it globablly so it wont explode
// and we'll at least fill in NODE_ENV becuase that's the most common thing that gets checked
if (typeof window !== "undefined") {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(window as any).process = { env: { NODE_ENV: import.meta.env.NODE_ENV } };
}

const app = createApp(App);

app.use(createHead());
Expand Down
1 change: 1 addition & 0 deletions app/web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export default (opts: { mode: string }) => {
find: "@",
replacement: path.resolve(__dirname, "src"),
},
{ find: "util", replacement: "util-browser" },
],
},
build: {
Expand Down
8 changes: 8 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 7628f8d

Please sign in to comment.