Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/large-turkeys-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

chore: improve readonly prop messaging
2 changes: 1 addition & 1 deletion packages/svelte/src/internal/client/proxy/readonly.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function readonly(value) {
*/
const readonly_error = (_, prop) => {
throw new Error(
`Non-bound props cannot be mutated — use \`bind:<prop>={...}\` to make \`${prop}\` settable. Fallback values can never be mutated.`
`Non-bound props cannot be mutated — to make the \`${prop}\` settable, ensure the object it is used within is bound as a prop \`bind:<prop>={...}\`. Fallback values can never be mutated.`
);
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export default test({
},

runtime_error:
'Non-bound props cannot be mutated — use `bind:<prop>={...}` to make `count` settable. Fallback values can never be mutated.'
'Non-bound props cannot be mutated — to make the `count` settable, ensure the object it is used within is bound as a prop `bind:<prop>={...}`. Fallback values can never be mutated.'
});
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export default test({
},

runtime_error:
'Non-bound props cannot be mutated — use `bind:<prop>={...}` to make `count` settable. Fallback values can never be mutated.'
'Non-bound props cannot be mutated — to make the `count` settable, ensure the object it is used within is bound as a prop `bind:<prop>={...}`. Fallback values can never be mutated.'
});