You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We love contributions big and small. PostHog Code is the IDE for understanding how users interact with your product -- and we want the community involved in shaping it.
4
+
5
+
## Getting started
6
+
7
+
1. Fork the repo and clone it locally
8
+
2. Follow the [Development setup](#development-setup) below
9
+
3. Create a branch (`feat/my-change`, `fix/that-bug`)
10
+
4. Make your changes and open a pull request
11
+
12
+
We recommend creating an issue first if one doesn't already exist so we can align on the approach before you invest time.
13
+
14
+
## Development setup
15
+
16
+
```bash
17
+
# Prerequisites: Node.js 22+, pnpm 10.23+
18
+
pnpm install
19
+
cp .env.example .env
20
+
pnpm dev
21
+
```
22
+
23
+
See [docs/LOCAL-DEVELOPMENT.md](./docs/LOCAL-DEVELOPMENT.md) for connecting to a local PostHog instance.
24
+
25
+
## Before submitting
26
+
27
+
- Run `pnpm typecheck`, `pnpm lint` and `pnpm test` locally
28
+
- Resolve merge conflicts before requesting review
29
+
- Keep changes focused -- one logical change per PR
30
+
- Add tests where they meaningfully improve confidence
31
+
- Follow existing patterns and conventions in the areas you touch (see [CLAUDE.md](./CLAUDE.md) for code style details)
32
+
33
+
## What to expect
34
+
35
+
- PRs are triaged and assigned to the relevant team
36
+
- Expect acknowledgement within a few days. Thorough reviews may take longer depending on load
37
+
- We sometimes close PRs that are out of scope or would add long-term maintenance burden. You're always welcome to reopen with updates
38
+
39
+
## Issues
40
+
41
+
Spotted a bug? Something broken? [Raise an issue](https://github.com/PostHog/code/issues/new) for the fastest response.
42
+
43
+
## Feature requests
44
+
45
+
Raise an issue and tag it as an enhancement. Give us as much context on the _why_ as possible -- we love hearing about the problem you're trying to solve.
46
+
47
+
If you're unsure whether something fits, open an issue first and we'll get back to you quickly.
Then restart the app. This downloads the codex-acp binary to `apps/code/resources/codex-acp/`, which gets copied to `.vite/build/codex-acp/` during build.
72
74
73
-
## Database initialization failed (better-sqlite3 bindings not found)
Database initialization failed Error: Could not locate the bindings file.
79
81
```
80
82
81
-
The `better-sqlite3` native binary wasn't compiled for your Electron version. This commonly happens after a merge, branch switch or fresh install because the postinstall rebuild can fail silently (`|| true`).
83
+
```
84
+
Database initialization failed Error: The module '.../better_sqlite3.node'
85
+
was compiled against a different Node.js version using
86
+
NODE_MODULE_VERSION 145. This version of Node.js requires
87
+
NODE_MODULE_VERSION 123.
88
+
```
89
+
90
+
The `better-sqlite3` native binary wasn't compiled for your Electron version. This commonly happens after a merge, branch switch or Electron upgrade because the postinstall rebuild can fail silently (`|| true`).
If you see this error after pulling or switching branches:
103
+
104
+
```
105
+
Error: node-gyp failed to rebuild '/path/to/node_modules/@parcel/watcher'
106
+
```
107
+
108
+
`@parcel/watcher` ships prebuilt N-API binaries per platform (e.g. `@parcel/watcher-darwin-arm64`) and should not need recompilation. This error usually means a stale or partial install state is triggering a source rebuild that fails.
109
+
110
+
### Fix
111
+
112
+
```bash
113
+
rm -rf node_modules/@parcel/watcher
114
+
pnpm install
115
+
```
116
+
117
+
If that doesn't work, nuke and reinstall:
118
+
119
+
```bash
120
+
rm -rf node_modules && pnpm install
121
+
```
122
+
123
+
Do **not** run `npx @electron/rebuild` against `@parcel/watcher` — it doesn't need it and the rebuild will fail.
124
+
91
125
## `pnpm i` shows "Packages: -198"
92
126
93
127
You might see something like this every time you run `pnpm install`:
0 commit comments