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
Finished release [optimized] target(s) in 1m 13s
2024-03-27T08:41:07.568Z napi:build Platform: freebsd
2024-03-27T08:41:07.569Z napi:build Platform name: .freebsd-x64
2024-03-27T08:41:07.569Z napi:build Write binary content to [css-inline.freebsd-x64.node]
Uncaught exception in __test__/index.spec.ts
Error: invalid type: unit value, expected struct Options
Error: invalid type: unit value, expected struct Options
at module.exports.__wbindgen_error_new (/Users/runner/work/css-inline/css-inline/bindings/javascript/node_modules/@swc/wasm/wasm.js:549:17)
at null.<anonymous> (wasm://wasm/0493877a:1:13340270)
at null.<anonymous> (wasm://wasm/0493877a:1:13693650)
at null.<anonymous> (wasm://wasm/0493877a:1:13851783)
at null.<anonymous> (wasm://wasm/0493877a:1:4298654)
at null.<anonymous> (wasm://wasm/0493877a:1:3174[530](https://github.com/Stranger6667/css-inline/actions/runs/8448847870/job/23141712265?pr=352#step:3:536))
at null.<anonymous> (wasm://wasm/0493877a:1:11246699)
at null.<anonymous> (wasm://wasm/0493877a:1:2101782)
at null.<anonymous> (wasm://wasm/0493877a:1:2889353)
at null.<anonymous> (wasm://wasm/0493877a:1:3517515)
✘ __test__/index.spec.ts exited with a non-zero exit code: 1
─
1 uncaught exception
The invalid type: unit value, expected struct Options part makes me think that it comes from the argument transformation step when serde fails to transform () to None (as I think it does with other platforms). Here is the code I have in the library:
#[cfg(not(target_arch = "wasm32"))]#[napi]/// Inline CSS styles from <style> tags to matching elements in the HTML tree and return a string.pubfninline(html:String,options:Option<Options>) -> Result<String, errors::JsError>{let options = options.unwrap_or_default();inline_inner(html, options)}
Hi!
I adapted the FreeBSD CI template to the following so it also runs
yarn test
and it results in a serde-level error:Fails with:
The
invalid type: unit value, expected struct Options
part makes me think that it comes from the argument transformation step when serde fails to transform()
toNone
(as I think it does with other platforms). Here is the code I have in the library:Test code that fails (and similar tests):
I assume that it expects an empty object as the second argument to
inline
. Relevant output fromcargo expand
:Relevant PR
Is it something that is not supported, or I have some configuration mistake on my side?
I'd appreciate any input on this
The text was updated successfully, but these errors were encountered: