Type definitions must be strings or objects (was undefined)
Hello!
When importing a module that is using Arktype, I get the error
Type definitions must be strings or objects (was undefined)
. I am not sure what it means. What should I be looking for to solve it?10 Replies
What specifically repros that error? That would be caused when you do something like
type(undefined)
Or type({foo: undefined})
During instantiation or assertion?
Instantiation when it parses the definition
I am not sure what causes it, I will go through the types now and hopefully find it
It's not a type-level issue (though maybe you mean runtime Types) it's probably a value that is typed as a string or something but is actually undefined
Otherwise it would be a type error
Or wait is it a type error?
Hahaha I guess I should have asked that I forgot we give that error in parallel between runtime and types
What about
Would this crash?
No that's fine
Is it a type or a runtime error though that is very important
It's a runtime error
Ahh okay
Can you use a debugger and just go up the stack to see what definition was being parsed when it fails? That should be straightforward
I think I found it:
With a model a utility function throws:
TypeError: Cannot convert undefined or null to object
So it's not an Arktype error