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

SvelteKit demo is broken due to "type" not being set in pkg json #780

Open
ksorv opened this issue Sep 16, 2024 · 1 comment
Open

SvelteKit demo is broken due to "type" not being set in pkg json #780

ksorv opened this issue Sep 16, 2024 · 1 comment

Comments

@ksorv
Copy link

ksorv commented Sep 16, 2024

Describe the bug
In the @ffmpeg/util package, there is no json "type": "module", Due to this vite breaks while building the code because it needs esm modules to run.

To Reproduce
Clone the sveltekit example, npm i, and npm run dev.

Expected behavior
The example should work when I do npm run dev

Screenshot
CleanShot 2024-09-16 at 12 01 37@2x

Desktop (please complete the following information):

  • OS: [e.g. iOS] - MacOS 14.6.1
  • Browser [e.g. chrome, safari] - Chrome
  • Version [e.g. 22] - 128

Additional context
Setting json "type": "module" in util package's package.json, the build worked.

@npgy
Copy link

npgy commented Sep 28, 2024

Another workaround that worked for me was importing from the index.js file explicitly:
import { fetchFile, toBlobURL } from '../../node_modules/@ffmpeg/util/dist/esm/index.js';

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

2 participants