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
The resolveId, load and transform hooks of the plugin are all async, which prevents using it with env-runner's SelfEnvRunner (its plugins run inside sync module.registerHooks loader hooks, and a hook returning a Promise fails the import). Nitro wants this for nitro serve without a worker.
None of them needs to be async: this.resolve() can be awaited only when it returns a Promise (env-runner's self runner returns the result directly), load can use readFileSync, and getWasmImports / readNearestPackageJSON can read package.json synchronously. With these changes applied to a local copy, Nitro's builder: false fixture (importing a .wasm with ESM exports) works on the self runner, while bundlers keep working since sync hooks are valid there.
Activity
feat(plugin): synchronous plugin hooks