Problem while integrating with Next-js #1522
-
I recently discover the amazing work you are doing with alphaTab and i wanted to give it a try to integrate with an app i'm developing. I'm using Nextjs as framework, and i encounter a problem while trying to integrate the alphaTabWebpack Plugin. I tried to push the pluging to the webpack config like this: const nextConfig = { export default nextConfig; . But i got this error : Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'webpack' imported from C:\Users\julia\Desktop\academia\node_modules@coderline\alphatab\dist\alphaTab.webpack.mjs |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
I gave things a small look and I'm sorry to say: we currently cannot not support Next.js there are too many things on how they compile and bundle. The Webpack import error is just the first hurdle but the problems go deeper after that. For now I have there two main findings:
While I could take some more things in our own hands in WebPack to reduce the dependencies, the key problem lies in the hidden I'm not sure if it is possible to support NextJS without adaptions in webpack and NextJS. For now I added https://github.com/orgs/CoderLine/projects/12?pane=issue&itemId=65623529 as a future work item to support Next.js. I'll have to reach out to both framework authors to expose the relevant bits for us. |
Beta Was this translation helpful? Give feedback.
-
Thank you so much for the response. I have decided to try the vite/react framework to incorporate alphaTab and its working really good. I'm gonna deploy the alphatab as a separate microservice and plug it into my existing app via an iframe element for now. I think for development and testing will be good enough for now. I´m too lazy to migrate my whole project to the vite/react environment, but maybe if there is no other option i would consider that also. Thank you so much for the fast response. |
Beta Was this translation helpful? Give feedback.
-
I just released alphaTab 1.3.1 fixing the known issues around Webpack. 🥳 https://github.com/CoderLine/alphaTabSamplesWeb/tree/main/src/webpack-nextjs |
Beta Was this translation helpful? Give feedback.
I just released alphaTab 1.3.1 fixing the known issues around Webpack. 🥳
https://github.com/CoderLine/alphaTabSamplesWeb/tree/main/src/webpack-nextjs
https://github.com/CoderLine/alphaTab/releases/tag/v1.3.1