I use the html function from hono (https://hono.dev/middleware/builtin/html) and a vscode extension for syntax highlighting (https://marketplace.visualstudio.com/items?itemName=bierner.lit-html).
At some point, tag functions in bun stopped working in a certain case. I realized this after starting a new project + updating to latest version of canary.
Here is an example of the problem:
function test(value: TemplateStringsArray) {
return new String(value)
}
// works
test`ok`
// @ts-ignore
test(`
ok
`)
// below lines will crash bun
test`
ok
`
Multi-line template literals in tag functions only work when enclosed in parenthesis. Is this intended behavior?
uh-oh: attempt to unwrap error
bun will crash now 😭😭😭
----- bun meta -----
Bun v0.6.8 (52d11ce8) Linux x64 #1 SMP Fri Apr 2 22:23:49 UTC 2021
AutoCommand:
Elapsed: 50ms | User: 21ms | Sys: 0ms
RSS: 33.55MB | Peak: 50.47MB | Commit: 33.55MB | Faults: 0
----- bun meta -----
0 0x555cd45aa45b
Crash report saved to:
~/.bun/.bun-crash/v0.6.8-1685921687534.crash
Search GitHub issues https://bun.sh/issues or ask for #help in https://bun.sh/discord
thread 2273 panic: attempt to unwrap error
Aborted