Got syntax error in some browser
Encountered an unexpected error while compiling your definition: ..
I guess it related to the token ??= syntax
17 Replies
Would need a little more context to know what this is lol
https://github.com/arktypeio/arktype/blob/main/ark/schema/roots/alias.ts#L116 the ?. and ??= isn’t supported in some older browsers
GitHub
arktype/ark/schema/roots/alias.ts at main · arktypeio/arktype
TypeScript's 1:1 validator, optimized from editor to runtime - arktypeio/arktype
Then you should probably transpile your code haha
It is generated code in runtime by arktype
So we cannot transpile it
You can use
jitless: true
I just patched the source code and it is working again
I will make a PR if needed
I guess I'll just change it locally since I'm making some changes to aliases anyways. Crazy you have to support such old browsers
caniuse report this feature is only valid for 93.4% of global users...
https://caniuse.com/?search=??%3D (and https://caniuse.com/?search=?.
I guess it's different since it can't be transpiled easily
Anyways, thanks for letting me know, hopefully I don't accidentally use it anywhere else
yes, if do a proper transpile, we need store it in a local variable to prevent eval twice
I only support back to
Node18
within ArkType directly
But yeah, didn't occur to me that transpiled code kind of needs a different standardEven
.map
is only 97% according to this hahabut it at least won't affect mobile user, they cannot upgrade the browser easily
if you selected tracked mobile for .map you will get 99.91% + 0.09% = 100%
Well I'll update it in the next release
Do you have some even older browsers to try by chance?
Would be interesting to see what the current limitations are
🤔
How do you even run all the tests in the browser, lemme see
chrome 80 in android emulator, I use it as baseline
oof 2020
looks fine enough