Issues integrating AlphaTab in Vite/React application - Iframe workaround successful #2378
Replies: 3 comments 1 reply
-
|
Have you looked into the following links?
The problems you mention indicate you have missed those references. |
Beta Was this translation helpful? Give feedback.
-
|
Hello! I apologize for the confusion in my previous issue. After further investigation, the performance problem was entirely due to my implementation choices, not AlphaTab itself. I was using ScrollMode.Continuous with scrollSpeed set to 300, and I also recently upgraded to Vite 6, which may have contributed to the issue. Switching to ScrollMode.OffScreen with a lower scroll speed (150) completely resolved the performance problems. AlphaTab is working beautifully now. Thank you for this excellent library! |
Beta Was this translation helpful? Give feedback.
-
|
Hi! Thanks for the quick response and suggestions! Yes, I'm using it correctly in my vite.config.ts plugins: [ Current config: Thanks again for your help! The library is working great overall. |
Beta Was this translation helpful? Give feedback.
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