Is there an existing issue for this?
Current Behavior
When bundling alphaTab with WebPack, and starting the playback, a browser error occurs:
:3001/_next/static/chunks/_app-pages-browser_node_modules_coderline_alphatab_dist_alphaTab_worklet_mjs.js:726 Uncaught ReferenceError: _N_E is not defined
Expected Behavior
No errors should occur in the alphaTab outputs using the WebPack plugin.
Steps To Reproduce
- https://github.com/CoderLine/alphaTabSamplesWeb/tree/main/src/webpack-nextjs-15
npm install && npm run dev
- Hit play
Link to jsFiddle, CodePen, Project
No response
Version and Environment
[AlphaTab][VersionInfo] alphaTab 1.6.2
alphaTab.core.mjs:2518 [AlphaTab][VersionInfo] commit: 7a3395e57a19e6e78397974ab295db87b6cc7bff
alphaTab.core.mjs:2518 [AlphaTab][VersionInfo] build date: 2025-08-23T16:08:14.997Z
alphaTab.core.mjs:2518 [AlphaTab][VersionInfo] High DPI: 3
alphaTab.core.mjs:2518 [AlphaTab][VersionInfo] Browser: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36
alphaTab.core.mjs:2518 [AlphaTab][VersionInfo] Platform: Browser
alphaTab.core.mjs:2518 [AlphaTab][VersionInfo] WebPack: true
alphaTab.core.mjs:2518 [AlphaTab][VersionInfo] Vite: false
alphaTab.core.mjs:2518 [AlphaTab][VersionInfo] Window Size: 1286x640
alphaTab.core.mjs:2518 [AlphaTab][VersionInfo] Screen Size: 1366x768
Platform
Web
Anything else?
The problem is:
- Audio worklets run in strict mode
- WebPack generates code which assigns the exports of this entry chunk to a global variable due to some global library settings which might be active. https://github.com/webpack/webpack/blob/main/lib/library/AssignLibraryPlugin.js#L14
We need to ensure that these Worker/Worklet output chunks do not cause such an assignment by setting the entryOptions accordingly.
Is there an existing issue for this?
Current Behavior
When bundling alphaTab with WebPack, and starting the playback, a browser error occurs:
Expected Behavior
No errors should occur in the alphaTab outputs using the WebPack plugin.
Steps To Reproduce
npm install && npm run devLink to jsFiddle, CodePen, Project
No response
Version and Environment
Platform
Web
Anything else?
The problem is:
We need to ensure that these Worker/Worklet output chunks do not cause such an assignment by setting the entryOptions accordingly.