Skip to content

fix(user-feedback): add missing lib/utils.ts excluded by root .gitignore - #36

Open
shubham88fru wants to merge 1 commit into
langfuse:mainfrom
shubham88fru:fix/user-feedback-missing-lib-utils
Open

fix(user-feedback): add missing lib/utils.ts excluded by root .gitignore#36
shubham88fru wants to merge 1 commit into
langfuse:mainfrom
shubham88fru:fix/user-feedback-missing-lib-utils

Conversation

@shubham88fru

Copy link
Copy Markdown

Fixes #15

Problem

The user-feedback example doesn't build out of the box. Reproducing with the Dockerfile from the issue:

./components/ai-elements/branch.tsx:4:1
Module not found: Can't resolve '@/lib/utils'

20 .tsx files in the example import cn from @/lib/utils, but applications/user-feedback/lib/ isn't in the repository at all.

Root cause

The file was never committed. The repo-root .gitignore contains a lib/ rule inherited from the gitignore.io Python template:

# .gitignore:288-295 (Python — Distribution / packaging)
downloads/
eggs/
.eggs/
lib/      <-- line 293
lib64/
parts/

Because that pattern has no leading slash, git applies it to a directory named lib at any depth — including applications/user-feedback/lib/. So when shadcn generated lib/utils.ts, a subsequent git add silently skipped it, and it was never noticed locally because the file exists on disk and the app builds fine there.

Confirmed on main:

$ git check-ignore -v applications/user-feedback/lib/utils.ts
.gitignore:293:lib/	applications/user-feedback/lib/utils.ts

Why the other examples aren't affected

applications/custom-annotation-ui hit the same trap and already carries the fix — its .gitignore has a !lib negation, and as a result its six lib/*.ts files are tracked normally:

$ git check-ignore -v applications/custom-annotation-ui/lib/utils.ts
$ echo $?
1   # not ignored

This PR simply brings user-feedback in line with that existing convention.

Changes

Two files, 7 lines:

  1. applications/user-feedback/.gitignore — add !lib immediately after !.yarn/versions. This region is now byte-identical to custom-annotation-ui/.gitignore. Without this, lib/utils.ts cannot be staged at all.
  2. applications/user-feedback/lib/utils.ts — the standard shadcn cn helper, byte-identical to applications/custom-annotation-ui/lib/utils.ts. clsx and tailwind-merge were already declared in package.json, so no dependency changes are needed.

I deliberately left the root .gitignore alone to keep this fix minimal — happy to send a follow-up scoping that lib/ rule to /lib/ if you'd prefer to prevent recurrences at the source.

Verification

Before (main, lib/ absent) — dev server returns HTTP 500 with the exact error from the issue.
After (this branch) — HTTP 200, npm run build exits 0 (✓ Compiled successfully).

npm run lint reports 16 pre-existing problems in prompt-input.tsx and branch.tsx. I verified against a pristine checkout that this is the unchanged baseline on main, so this PR introduces no new lint issues. Left untouched as out of scope.

End-to-end run against real OpenAI + Langfuse Cloud credentials — the chat UI renders, GPT-4o Mini responds, and the feedback score reaches Langfuse (/api/public/ingestion201, visible in the Network tab):

Local verification: chat renders, response streams, feedback ingested with status 201

Note on #29

#29 (kiro-langfuse missing hooks/lib/) appears to have the same root cause — that path is caught by the same line 293 rule. It needs several modules reconstructed rather than one, so I've kept it out of this PR, but I'm happy to pick it up separately if that's useful.

@CLAassistant

CLAassistant commented Jul 26, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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 this pull request may close these issues.

Build errors with user-feedback example

2 participants