You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
add the statement at the top of file; export const runtime='edge'
it will throw an error; Error: Invalid type: Expected Object but received Object
it should also throw an error for other frameworks optiong into edge runtime
The text was updated successfully, but these errors were encountered:
ammarriq
changed the title
v31 doesn't work with edge runtime
[v31] Invalid type: Expected Object but received Object because of edge runtime
May 25, 2024
ammarriq
changed the title
[v31] Invalid type: Expected Object but received Object because of edge runtime
[v31] Invalid type: Expected Object but received Object because of edge runtime
May 25, 2024
ammarriq
changed the title
[v31] Invalid type: Expected Object but received Object because of edge runtime
[v0.31.0-rc.5] Invalid type: Expected Object but received Object because of edge runtime
May 25, 2024
There are other problems with the current plain object check, for example in #587, but I am not sure if Valibot is the problem. Normally, this should not be a problem. We could remove the input.constructor === Object check to make it less strict, but then any object that is not null will be accepted. In practice, this is usually not a problem because we never return the original object. So, strictly speaking, the validation is still safe. Therefore, I might make the validation less strict so as not to have to deal with special JS runtime behavior that we can't control.
One problematic case that just came to my mind that could lead to unexpected behavior is our looseObject and objectWithRest schemas, as they can add unexpected data to the output if the wrong object types are passed.
Valibot object schema doesn't seem to work with
edge
runtimeSteps to reproduce;
export const runtime='edge'
it will throw an error;
Error: Invalid type: Expected Object but received Object
it should also throw an error for other frameworks optiong into
edge
runtimeThe text was updated successfully, but these errors were encountered: