The 'Cannot find module as expression is too dynamic' error occurs at runtime
when FFmpeg tries to dynamically load the core module. Using CDN URLs bypasses
this bundler issue entirely since absolute URLs don't require bundler analysis.
Switched to jsdelivr CDN for FFmpeg core and WASM files - this is a proven
approach used by many projects.
Fixes: wasmLoader.ts runtime error on media conversion
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Import FFmpeg at module level instead of dynamic import. The build now
compiles cleanly without Turbopack bundler warnings.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The @ffmpeg/ffmpeg package has internal dynamic imports that Turbopack
cannot statically analyze, but they work fine at runtime. This change
moves the import to the loadFFmpeg function where it's needed, allowing
Turbopack to skip static analysis and let the bundler resolve it at runtime.
Fixes: Cannot find module as expression is too dynamic error
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- moved FFmpeg and initializeImageMagick imports to top level (static)
- removed dynamic imports that caused bundler analysis issues
- simplified ImageMagick initialization
- fixes: 'Cannot find module as expression is too dynamic' error
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>