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

Solve 'SyntaxError: import declarations may only appear at top level of a module' in Firefox #17

Closed
pjlammertyn opened this issue Apr 12, 2023 · 0 comments
Assignees

Comments

@pjlammertyn
Copy link
Contributor

cfr vitejs/vite#4586

already tried: sveltejs/kit#9528

const DataTableWorker = await import('$lib/workers/DataTable.worker?worker')
this.worker = new DataTableWorker.default()

//can also be written as 

import workerUrl from '$lib/workers/DataTable.worker?url';
this.worker = new Worker(workerUrl, { type: 'module' });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants