Skip to content

Commit

Permalink
Improve the error message for dynamic css functions when returning in…
Browse files Browse the repository at this point in the history
…valid values
  • Loading branch information
jantimon committed Dec 4, 2024
1 parent 3d6e505 commit 1973100
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/blue-donuts-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"next-yak": patch
---

Improve the error message for dynamic css functions when returning invalid values
2 changes: 1 addition & 1 deletion packages/next-yak/runtime/cssLiteral.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ const recursivePropExecution = (
throw new Error(
`Dynamic CSS functions must return a string or number but returned ${JSON.stringify(
result,
)}`,
)}\n\nDynamic CSS function: ${fn.toString()}\n`,
);
}
}
Expand Down

0 comments on commit 1973100

Please sign in to comment.