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

[Help] How to use Import inside worker #497

Open
lannodev opened this issue Jun 19, 2024 · 1 comment
Open

[Help] How to use Import inside worker #497

lannodev opened this issue Jun 19, 2024 · 1 comment
Labels
help wanted Extra attention is needed

Comments

@lannodev
Copy link

lannodev commented Jun 19, 2024

I'm trying to use import within the web worker in the rendering process, but it doesn't do anything. I didn't print the test console. If I remove the import it works.

myWorkerScript:

import { BasicPitch, addPitchBendsToNoteEvents, noteFramesToTime, outputToNotesPoly } from '@spotify/basic-pitch';

console.log('test');

self.addEventListener('message', async (event) => {
  const message = event.data;
  const midiNotes = await getMidNotes(message.decodedSong);

  self.postMessage({
    status: 'complete',
    data: midiNotes
  });
});

Is there a way for it to work?

@lannodev lannodev added the help wanted Extra attention is needed label Jun 19, 2024
@oceanlvr
Copy link
Member

Could you please offer the minimum demo repo?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants