Open jacob-local-kevin[bot] opened 4 months ago
JACoB here...
You mentioned me on this issue and I am busy taking a look at it.
I'll continue to comment on this issue with status as I make progress.
Unfortunately, I ran into trouble working on this.
Here is some error information:
Command failed: __NEXT_TEST_MODE=1 SKIP_ENV_VALIDATION=1 npm run build --verbose && npx tsc --noEmit
npm verbose cli /Users/kleneway/.nvm/versions/node/v20.10.0/bin/node /Users/kleneway/.nvm/versions/node/v20.10.0/bin/npm
npm info using npm@10.8.2
npm info using node@v20.10.0
npm verbose title npm run build
npm verbose argv "run" "build" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:/Users/kleneway/.npm/_logs/2024-07-26T21_14_37_512Z-
npm verbose logfile /Users/kleneway/.npm/_logs/2024-07-26T21_14_37_512Z-debug-0.log
===== TS errors =====
[Test Mode] ./src/components/ui/dialog.tsx:14:3
Type error: Property 'className' does not exist on type 'DialogPortalProps'.
12 |
13 | const DialogPortal = ({
> 14 | className,
| ^
15 | ...props
16 | }: DialogPrimitive.DialogPortalProps) => (
17 | <DialogPrimitive.Portal className={cn(className)} {...props} />
[Test Mode] ./src/components/ui/dialog.tsx:17:27
Type error: Type '{ children?: ReactNode; container?: Element | null | undefined; forceMount?: true | undefined; className: string; }' is not assignable to type 'IntrinsicAttributes & DialogPortalProps'.
Property 'className' does not exist on type 'IntrinsicAttributes & DialogPortalProps'.
15 | ...props
16 | }: DialogPrimitive.DialogPortalProps) => (
> 17 | <DialogPrimitive.Portal className={cn(className)} {...props} />
| ^
18 | )
19 | DialogPortal.displayName = DialogPrimitive.Portal.displayName
20 |
===== TS errors =====
Failed to compile.
./src/components/ui/dialog.tsx:14:3
Type error: Property 'className' does not exist on type 'DialogPortalProps'.
12 |
13 | const DialogPortal = ({
> 14 | className,
| ^
15 | ...props
16 | }: DialogPrimitive.DialogPortalProps) => (
17 | <DialogPrimitive.Portal className={cn(className)} {...props} />
npm verbose cwd /private/tmp/tmp-34557-wJh403DbwN79
npm verbose os Darwin 23.4.0
npm verbose node v20.10.0
npm verbose npm v10.8.2
npm verbose exit 1
npm verbose code 1
Fix DialogPortal Type Error in dialog.tsx
Problem Description and Objectives
The TypeScript compiler is throwing an error in the
dialog.tsx
file because theclassName
property does not exist on theDialogPortalProps
type. This error is causing the build to fail. The objective is to resolve this TypeScript error by ensuring that theclassName
property is correctly handled.Files to Update:
src/components/ui/dialog.tsx
Requirements:
Update the
DialogPortal
component:className
property is correctly typed and passed to theDialogPrimitive.Portal
component.DialogPortalProps
type to include theclassName
property.Verify the TypeScript types:
DialogPortalProps
type from the@radix-ui/react-dialog
library is correctly extended or modified to includeclassName
.Handle Edge Cases:
className
property is not provided.Acceptance Criteria:
DialogPortal
component should no longer throw a TypeScript error related to theclassName
property.DialogPortal
component should function correctly with and without theclassName
property.Additional Context:
The error occurs in the following lines of
src/components/ui/dialog.tsx
:The
DialogPortalProps
type is imported from the@radix-ui/react-dialog
library. Ensure that any modifications are consistent with the library's type definitions.@jacob-ai-bot
Steps to Address Issue: 1. Open src/components/ui/dialog.tsx
Files to Update: src/components/ui/dialog.tsx
task assigned to: @jacob-ai-bot