Importing the alphaTab WebPack plugin in ESM fails. #1523
Labels
area-bundlers
Related to the bundler plugins like webpack and vite
platform-javascript
Related to the JavaScript version of alphaTab
state-accepted
This is a valid topic to work on.
Milestone
Is there an existing issue for this?
Current Behavior
import { AlphaTabWebPackPlugin } from "@coderline/alphatab/webpack";
in a ESM file leads to import errors like:This is because for ESM imports in node file extensions are mandatory: https://nodejs.org/api/esm.html#esm_mandatory_file_extensions
But the webpack plugin imports some webpack files directly without extension
Expected Behavior
Imports must work.
Steps To Reproduce
npx create-next-app@latest
import { AlphaTabWebPackPlugin } from "@coderline/alphatab/webpack";
to the next.config.mjsnpm run dev
Link to jsFiddle, CodePen, Project
No response
Found in Version
1.3
Platform
Web
Environment
Anything else?
Adding the
.js
extension to the modules fixes the problem. In CJS files the require without extension works.The text was updated successfully, but these errors were encountered: