Issues integrating AlphaTab in Vite/React application - Iframe workaround successful #2378
Unanswered
vapingpost
asked this question in
Q&A
Replies: 1 comment
-
|
Have you looked into the following links?
The problems you mention indicate you have missed those references. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone, I've spent significant time trying to integrate AlphaTab into a Vite + React + TypeScript application and encountered several persistent issues. I wanted to share my experience in case it helps others or if you have suggestions.
Environment:
Issues encountered:
Worker/Worklet loading errors: Despite trying multiple Vite configuration approaches (including vite-plugin-static-copy, manual public folder placement, and custom worker configurations), AlphaTab consistently failed to load its worker and worklet files properly.
Build vs Dev inconsistencies:
Some approaches worked in dev mode but failed in production builds.
Solution that worked
We created a standalone HTML page (guitar-pro-player.html) that loads AlphaTab via CDN:
<script src="https://cdn.jsdelivr.net/npm/@coderline/alphatab@latest/dist/alphaTab.js"></script>Then we embedded this page in our React app using an iframe with postMessage communication for controls. This approach works perfectly and audio plays correctly.
Question: Is there a recommended way to integrate AlphaTab in modern Vite/React applications without using an iframe? Are there specific Vite configurations or AlphaTab initialization options we should use?
Thank you for this amazing library!
Beta Was this translation helpful? Give feedback.
All reactions