Describe the bug
It seems it's not possible to import @swc/html in a StackBlitz WebContainer sandbox, probably due to a Wasm binding problem?
Input code
async function test1() {
await import('@swc/core');
}
async function test2() {
await import('@swc/html');
}
async function testAll() {
return Promise.allSettled([test1(), test2()]);
}
testAll().then(console.log, console.error);
Config
Link to the code that reproduces this issue
https://stackblitz.com/edit/stackblitz-starters-apgxgccc?file=package.json,index.js
SWC Info output
No response
Expected behavior
@swc/html can be imported in a StackBlitz WebContainer sandbox
Actual behavior
@swc/html fails to import due to binding issues, while @swc/core can be imported successfully
node index.js
[
{ status: 'fulfilled', value: undefined },
{
status: 'rejected',
reason: Error: Failed to load native binding
at Object.eval (/home/projects/stackblitz-starters-apgxgccc/node_modules/@swc/html/binding.js:350:15)
at Module._compile (node:internal/modules/cjs/loader:160:18351)
at Module._extensions..js (node:internal/modules/cjs/loader:160:19092)
at Module.load (node:internal/modules/cjs/loader:160:16623)
at Module._load (node:internal/modules/cjs/loader:160:14286)
at TracingChannel.traceSync (node:diagnostics_channel:26:3678)
at wrapModuleLoad (node:internal/modules/cjs/loader:160:3949)
at Module.require (node:internal/modules/cjs/loader:160:16804)
at require2 (node:internal/modules/helpers:177:3120)
}
Version
1.15.32
Additional context
StackBlitz repro: https://stackblitz.com/edit/stackblitz-starters-apgxgccc?file=package.json,index.js
Describe the bug
It seems it's not possible to import
@swc/htmlin a StackBlitz WebContainer sandbox, probably due to a Wasm binding problem?Input code
Config
Link to the code that reproduces this issue
https://stackblitz.com/edit/stackblitz-starters-apgxgccc?file=package.json,index.js
SWC Info output
No response
Expected behavior
@swc/htmlcan be imported in a StackBlitz WebContainer sandboxActual behavior
@swc/htmlfails to import due to binding issues, while@swc/corecan be imported successfullyVersion
1.15.32
Additional context
StackBlitz repro: https://stackblitz.com/edit/stackblitz-starters-apgxgccc?file=package.json,index.js