Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vite build does not work with alphaTab's worker #1289

Closed
1 task done
fheyen opened this issue Oct 31, 2023 · 2 comments
Closed
1 task done

vite build does not work with alphaTab's worker #1289

fheyen opened this issue Oct 31, 2023 · 2 comments
Assignees
Labels
state-needs-triage Bug not triaged yet.

Comments

@fheyen
Copy link

fheyen commented Oct 31, 2023

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I'm importing alphaTab as a node module in a svelte/vite project ().

While the developing mode works fine, building leads to the following error:

Unexpected early exit. This happens when Promises returned by plugins cannot resolve. 
Unfinished hook action(s) on exit:
(vite:worker-import-meta-url) transform "[...]/visual-guitar-tab-comparison/visual-guitar-tab-comparison/node_modules/@coderline/alphatab/dist/alphaTab.mjs"
error during build:
Error: Unexpected early exit. This happens when Promises returned by plugins cannot resolve. 
Unfinished hook action(s) on exit:
(vite:worker-import-meta-url) transform "[...]/visual-guitar-tab-comparison/visual-guitar-tab-comparison/node_modules/@coderline/alphatab/dist/alphaTab.mjs"
    at process.handleBeforeExit (file:///[...]/visual-guitar-tab-comparison/visual-guitar-tab-comparison/node_modules/rollup/dist/es/shared/node-entry.js:25902:28)
    at Object.onceWrapper (node:events:629:26)
    at process.emit (node:events:514:28)

I suspect this happens because the worker file is not imported in the way that rollup expects it to be.

I created a minimal example.

Expected Behavior

vite build works without error

Steps To Reproduce

  1. Check out https://github.com/visvar/visual-guitar-tab-comparison
  2. cd build-reproduce
  3. npm install
  4. npm run build

Link to jsFiddle, CodePen, Project

https://github.com/visvar/visual-guitar-tab-comparison

Found in Version

1.3-alpha

Platform

Node.js

Environment

- **OS**: Windows 10
- **Node**: 20.8.1
- **vite**: 4.5.0

Anything else?

No response

@fheyen fheyen added the state-needs-triage Bug not triaged yet. label Oct 31, 2023
@Danielku15
Copy link
Member

You will have to check how to configure rollup in your project.

https://www.alphatab.net/docs/getting-started/installation-web#bundling
https://www.alphatab.net/docs/reference/settings/core/scriptfile/

#759
#699
#662

Closing as duplicate.

@Danielku15 Danielku15 closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2023
@fheyen
Copy link
Author

fheyen commented Nov 16, 2023

I will probably have to include alphaTab as <script> then.

As you linked to https://www.alphatab.net/docs/reference/settings/core/scriptfile/ ... I tried this option but could not find the file for the web worker, which one is it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state-needs-triage Bug not triaged yet.
Projects
None yet
Development

No branches or pull requests

2 participants