We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When building my local project, as well as when building the examples in this repo, a build error occurs. The clockworker.js script is not found.
clockworker.js
I’ve checked the Vite docs, and I think the error occurs because of how the import statement is written in neocyclist.js.
neocyclist.js
If I re-write is as described in the Vite docs, the build command runs without errors:
import { logger } from './logger.mjs'; +import SharedWorker from './clockworker.js?sharedworker' export class NeoCyclist { constructor({ onTrigger, onToggle, getTime }) { this.started = false; this.cps = 0.5; this.lastTick = 0; // absolute time when last tick (clock callback) happened this.getTime = getTime; // get absolute time this.time_at_last_tick_message = 0; this.num_cycles_at_cps_change = 0; this.onToggle = onToggle; this.latency = 0.1; // fixed trigger time offset this.cycle = 0; this.id = Math.round(Date.now() * Math.random()); this.worker_time_dif; - this.worker = new SharedWorker(new URL('./clockworker.js', import.meta.url)); + this.worker = new SharedWorker() this.worker.port.start();
NB: I have not been able to confirm that the worker still works with this solution, only that the build command succeeds, and that I get sound.
I have created a minimal reproducible example here: https://github.com/spitlo/strudel-web-build-error-mre/
Install dependencies and run the build command (I use yarn build) to see the error.
yarn build
The text was updated successfully, but these errors were encountered:
I did some testing, and I think that this is fixed as of #1129, which should be released shortly. I can double-check once the new version is out.
Sorry, something went wrong.
great, maybe this also removes the need for a prebuild script in flok: https://github.com/munshkr/flok/blob/main/packages/web/script/prebuild.js
No branches or pull requests
When building my local project, as well as when building the examples in this repo, a build error occurs. The
clockworker.js
script is not found.I’ve checked the Vite docs, and I think the error occurs because of how the import statement is written in
neocyclist.js
.If I re-write is as described in the Vite docs, the build command runs without errors:
NB: I have not been able to confirm that the worker still works with this solution, only that the build command succeeds, and that I get sound.
I have created a minimal reproducible example here:
https://github.com/spitlo/strudel-web-build-error-mre/
Install dependencies and run the build command (I use
yarn build
) to see the error.The text was updated successfully, but these errors were encountered: