Is there an existing issue for this?
Current Behavior
@coderline/alphatab-vite's package.json declares "vite": "^7 || ^8" in peerDependencies, suggesting Vite 8 is supported. However, adding the alphaTab() plugin to a Vite 8 project's vite.config.ts and running vite build fails every time with a rolldown native-binding error while the plugin is bundling alphaTab's worker entry. This reproduces on both 1.8.3 and 1.8.4.
Expected Behavior
Expected Behavior
Build completes successfully, with the plugin bundling alphaTab's worker/worklet assets as documented.
Actual Behavior
Build fails with:
[plugin vite-plugin-alphatab-url] node_modules/@coderline/alphatab/dist/alphaTab.mjs
Error: Build failed with 1 error:
Error: The function returned undefined, but expected object in
Arc<ThreadsafeFunction<FnArgs<(String, BindingLog)>, Either<Promise<()>, InvalidReturnValue>, FnArgs<(String, BindingLog)>, Status, false, true>>.
at aggregateBindingErrorsIntoJsError (.../@coderline/alphatab-vite/dist/dist.mjs:885:18)
at unwrapBindingResult (.../@coderline/alphatab-vite/dist/dist.mjs:859:128)
at #build (.../@coderline/alphatab-vite/dist/dist.mjs:6327:34)
at async bundleWorkerEntryRolldown (.../@coderline/alphatab-vite/dist/bridge/worker.mjs:162:22)
at async bundleWorkerEntry (.../@coderline/alphatab-vite/dist/bridge/worker.mjs:111:62)
at async workerFileToUrl (.../@coderline/alphatab-vite/dist/bridge/worker.mjs:73:23)
at async TransformPluginContextImpl.transform (.../@coderline/alphatab-vite/dist/importMetaPlugin.mjs:132:29)
...
at #build (.../rolldown/dist/shared/rolldown-build-....mjs:3317:34)
at async buildEnvironment (.../vite/dist/node/chunks/node.js:33018:64)
There's also an accompanying warning during the same build, which may or may not be related:
node_modules/@coderline/alphatab/dist/alphaTab.core.mjs (64771:21) [EMPTY_IMPORT_META] Warning:
import.meta may not be a valid syntax with the iife output format.
const importUrl = import.meta.url;
This import.meta will be replaced with an empty object ({}) automatically.
Steps To Reproduce
- Create (or use) a Vite 8 project (
vite@8.0.10, which uses rolldown as its bundler).
npm install @coderline/alphatab-vite@1.8.4 --save-dev
- Add the plugin to
vite.config.ts:
import { alphaTab } from '@coderline/alphatab-vite';
export default defineConfig({
plugins: [
alphaTab(),
// ...other plugins
],
});
Run npm run build (i.e. vite build).
Link to jsFiddle, CodePen, Project
No response
Version and Environment
- `@coderline/alphatab-vite`: 1.8.4 (also reproduces on 1.8.3)
- `@coderline/alphatab`: 1.8.3
- `vite`: 8.0.10
- `rolldown` (bundled with Vite 8): 1.0.0-rc.17
- Node: v22.22.3
- OS: macOS 24.6.0 (Darwin), x86_64
Platform
Web
Anything else?
Additional Context
The error originates in the plugin's own worker-bundling code (bundleWorkerEntryRolldown), which appears to invoke rolldown's native binding API in a way that's incompatible with the rolldown version Vite 8 bundles (1.0.0-rc.17).
Without the plugin registered at all, the rest of the build succeeds fine — we're currently working around this by manually copying alphaTab's worker/worklet/font/soundfont assets into public/ ourselves and disabling Web Workers for alphaTab (rendering on the main thread instead), which works but is a maintenance burden and a mild performance regression versus the intended worker-based setup.
Happy to provide a minimal reproduction repo if useful.
Is there an existing issue for this?
Current Behavior
@coderline/alphatab-vite'spackage.jsondeclares"vite": "^7 || ^8"inpeerDependencies, suggesting Vite 8 is supported. However, adding thealphaTab()plugin to a Vite 8 project'svite.config.tsand runningvite buildfails every time with a rolldown native-binding error while the plugin is bundling alphaTab's worker entry. This reproduces on both 1.8.3 and 1.8.4.Expected Behavior
Expected Behavior
Build completes successfully, with the plugin bundling alphaTab's worker/worklet assets as documented.
Actual Behavior
Build fails with:
There's also an accompanying warning during the same build, which may or may not be related:
Steps To Reproduce
vite@8.0.10, which uses rolldown as its bundler).npm install @coderline/alphatab-vite@1.8.4 --save-devvite.config.ts:Run npm run build (i.e. vite build).
Link to jsFiddle, CodePen, Project
No response
Version and Environment
Platform
Web
Anything else?
Additional Context
The error originates in the plugin's own worker-bundling code (bundleWorkerEntryRolldown), which appears to invoke rolldown's native binding API in a way that's incompatible with the rolldown version Vite 8 bundles (1.0.0-rc.17).
Without the plugin registered at all, the rest of the build succeeds fine — we're currently working around this by manually copying alphaTab's worker/worklet/font/soundfont assets into public/ ourselves and disabling Web Workers for alphaTab (rendering on the main thread instead), which works but is a maintenance burden and a mild performance regression versus the intended worker-based setup.
Happy to provide a minimal reproduction repo if useful.