Closed xmlking closed 2 hours ago
The first issue I see is you that are running formsnap@2.0.0-next
on the package and then formsnap@1.x
in the app. I'll work on updating the internals so that differing versions of 2.x will be compatible with one another. In the meantime, if they run the same version all will work as expected.
Also, I'm still working on documentation for formsnap@next, but getFormField
now returns a class instance with various properties, so you can't destructure but don't need to subscribe.
const field = getFormField()
console.log(field.errors)
console.log(field.constraints)
// etc.
Going to close this now, docs will be coming soon!
Describe the bug
I have a monrepo where custom input component is in a package and my webapp is in other package, I want to pass context to the child component loaded from external package/lib which accessing parent context with
const { errors } = getFormField();
Path: apps/myapp/ apps/myapp/src/routes/+page.svelte
Path:packages/smart/src/components/smart-textarea.svelte
getting this error when I
pnpm run build
andpnpm run preview
The code works without error when running on dev mode
pnpm run dev
Reproduction
chaild component https://github.com/xmlking/spectacular/blob/d50f414b92e4fc721b9cccb8de569d6588b85c72/packages/smart/src/components/smart-textarea.svelte#L78
parent component https://github.com/xmlking/spectacular/blob/d50f414b92e4fc721b9cccb8de569d6588b85c72/apps/console/src/routes/(app)/ai/writing/%2Bpage.svelte#L70
Logs
System Info
Severity
annoyance