databuddy-analytics / databuddy-analytics/Databuddy

dev: dashboard fails on fresh checkout when devtools dist is missing

Open Beginner friendly
#643 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
1.2k
Forks
216
Avg merge
14h 53m
Merged PRs (30d)
154

Description

Summary

bun run dev:dashboard can fail on a fresh checkout because the dashboard imports @databuddy/devtools/react, but the dev task only builds @databuddy/sdk before starting the apps.

@databuddy/devtools exports ./react from ./dist/react/index.mjs, so when packages/devtools/dist has not been built yet, Next/Turbopack cannot resolve the dashboard layout import.

Reproduction

  1. Start from a checkout where packages/devtools/dist is absent. I reproduced this locally by moving that directory out of the way.
  2. Run bun run dev:dashboard.
  3. Request http://localhost:3000/login so apps/dashboard/app/layout.tsx compiles.

Actual behavior

The route returns 500 and Next reports:

Module not found: Can't resolve '@databuddy/devtools/react'
./apps/dashboard/app/layout.tsx:6:1

Expected behavior

bun run dev:dashboard should prepare all dist-only workspace packages required by the dashboard, then /login should compile without a manual devtools build step.

Local verification

After the failure above, I ran:

bun run build --filter @databuddy/devtools

That recreated packages/devtools/dist, and the same /login request returned 200 OK on the same dev server.

Likely fix

turbo.json currently has:

"dev": {
  "dependsOn": ["@databuddy/sdk#build"],
  "cache": false,
  "persistent": true
}

A small fix would add the devtools build prerequisite for the dashboard dev path as well, either globally on dev or as a dashboard-specific task if that is preferred.

Happy to open a focused PR against staging if this direction looks right.

Disclosure

I used AI assistance to inspect the repo and format this report. I manually reproduced the failure, verified the 500 response, ran the devtools build, and verified the route recovered with 200 OK.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in turbo.json, where the dev task currently depends on the SDK build, and inspect the dashboard dev command and @databuddy/devtools package. Reproduce with bun run dev:dashboard from a checkout without packages/devtools/dist, then verify that the prerequisite is built and /login returns 200 without a manual build step.

Written by the indexing model from the issue text.

Assessment

Tech stack
bun, next.js, typescript
Domain
build-system, developer-experience
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.