Open torbjorn-kvist opened 2 months ago
1.1.12
Darwin 22.4.0 arm64 arm
import Elysia, { t } from 'elysia' export const userSchema = t.Intersect([ t.Object({ some: t.Optional(t.String()) }), t.Object({ some3: t.Optional(t.String()), avatar: t.Optional(t.File()), }), ]) const app = new Elysia().post('/test', () => ({}), { body: userSchema, response: userSchema, }) const formData = new FormData() formData.append('some', 'value') formData.append('some3', 'value') formData.append('avatar', new File([''], 'avatar.png')) const response = await app.handle( new Request('http://localhost/test', { method: 'POST', body: formData, }), ) console.log(response, await response.text())
No errors and working similar to when directly creating the t.Object without using t.Intersect
export const userSchema = t.Object({ some: t.Optional(t.String()), some3: t.Optional(t.String()), avatar: t.Optional(t.File()), })
Throws {"name":"Error","message":"ValueClone: Unable to clone value"}
{"name":"Error","message":"ValueClone: Unable to clone value"}
Probably a similar issue as #796
node_modules
bun.lockb
Yes
What version of Elysia is running?
1.1.12
What platform is your computer?
Darwin 22.4.0 arm64 arm
What steps can reproduce the bug?
What is the expected behavior?
No errors and working similar to when directly creating the t.Object without using t.Intersect
What do you see instead?
Throws
{"name":"Error","message":"ValueClone: Unable to clone value"}
Additional information
Probably a similar issue as #796
Have you try removing the
node_modules
andbun.lockb
and try again yet?Yes