godaddy / godaddy/kubernetes-client

Require is not defined

Open
#760 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
963
Forks
189
PR merge metrics
No merged PRs in 30d

Description

this is my code:
```
import "kubernetes-client"
const client = require('kubernetes-client').Client;
```

This is the error:
```
➜ Local: http://localhost:5173/
➜ Network: use --host to expose
➜ press h to show help
Kubernetes targetApiHost is https://138.197.92.32:6443
1:04:31 PM [vite] Error when evaluating SSR module /src/lib/database.ts:
|- ReferenceError: require is not defined
at eval (/Users/skiwheelr/ui/src/lib/database.ts:18:16)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async instantiateModule (file:///Users/skiwheelr/ui/node_modules/vite/dist/node/chunks/dep-e8f070e8.js:54405:9)
```

Contributor guide

Open the contributing guide

Research direction

Read src/lib/database.ts at the failing line and inspect how the Kubernetes client is loaded in the Vite SSR path. Reproduce the reported ReferenceError, then verify the client can be initialized without that error.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, kubernetes, node.js
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.