Next.js Integration FAQ
Frequently asked questions and common issues when integrating@distralabs/media-editor with Next.js.
Table of Contents
- React Version Issues
- Module Resolution Errors
- License Validation Problems
- WASM Loading Failures
- UI/Styling Issues
- Video Processing Issues
- Build and Deployment
React Version Issues
Error: “Cannot read properties of undefined (reading ‘ReactCurrentOwner’)”
Cause: Next.js 15+ requires React 19, but the media-editor SDK requires React 18.2.0. This creates a version conflict. Solution: Downgrade to Next.js 14.2.15 which supports React 18:Error: TypeScript Config Not Supported
Cause: Next.js 14 doesn’t supportnext.config.ts (TypeScript config).
Solution:
Rename next.config.ts to next.config.js:
Error: Font “Geist” Not Found
Cause: Geist font is only available in Next.js 15+. Solution: Use a standard Google Font like Inter:Module Resolution Errors
Error: “Module not found: Can’t resolve ‘@distralabs/media-editor’”
Cause: Package not installed or path aliases conflicting. Solution 1 - Verify Installation:next.config.js and remove any custom path aliases that might conflict:
Error: “Module not found: Can’t resolve ’./Users/Deep/media-editor/dist/…’”
Cause: Old path aliases orfile:.. dependency reference still in package.json.
Solution:
- Remove any
file:references from package.json - Use the published npm package:
- Clean and reinstall:
License Validation Problems
Error: “License Validation Failed - Failed to validate license”
Cause 1: CORS blocking the license validation API. Solution: Use your local API endpoint instead of the remote one:/license/validate to the apiUrl. Verify your backend endpoint:
- If your endpoint is
https://localhost:3030/social/license/validate - Then use
apiUrl="https://localhost:3030/social"
Error: “POST http://localhost:3030/social/license/validate net::ERR_EMPTY_RESPONSE”
Cause: Backend server not running or certificate issues with https. Solution:- Start your backend server:
- Verify it’s accessible:
- If using self-signed certificate, accept it in browser first by visiting the URL directly.
WASM Loading Failures
Error: “MediaInfoModule.wasm 404 Not Found”
Cause: WASM files not copied to public folder or wrong paths. Solution 1 - Copy WASM Files:/studio/video, add rewrites to next.config.js:
Error: “failed to asynchronously prepare wasm: both async and sync fetching of the wasm failed”
Cause: Browser can’t load WASM file due to wrong path or CORS. Solution:- Open browser DevTools → Network tab
- Look for failed requests to WASM files
- Check the requested URL vs actual file location
- Verify
public/folder contains all WASM files - Hard refresh browser (Cmd+Shift+R / Ctrl+Shift+R)
UI/Styling Issues
Issue: Timeline Looks Different in Next.js vs React
Cause: SDK CSS not imported. Solution: Add SDK CSS to your global styles: app/globals.css:Issue: Editor Theme Not Applied
Cause: Theme props not passed correctly or showThemeCreator enabled. Solution:Warning: “Each child in a list should have a unique ‘key’ prop”
Cause: React warnings from within the SDK bundle. Impact: These are development warnings only and don’t affect functionality. Solution: No action needed. These warnings come from the SDK itself and will not appear in production builds.Video Processing Issues
Issue: Video Export Takes Too Long
Cause: Video processing is CPU-intensive and happens in the browser. Typical Times:- 720p 10s video: ~30 seconds
- 1080p 30s video: ~2 minutes
- 4K video: May not work (memory constraints)
- Show progress indicator to user
- Recommend shorter clips or lower resolution
- Consider server-side processing for long videos
Issue: Video Export Fails on Mobile
Cause: Mobile browsers have limited memory and don’t support all WebAssembly features. Solution:- Detect mobile and show warning:
- Or disable video features on mobile entirely.
Issue: Audio Missing from Exported Video
Cause: Audio processing not enabled or audio track not detected. Solution: Verify the source video has audio:Build and Deployment
Error: Build Fails with “window is not defined”
Cause: SDK code being executed during SSR (server-side rendering). Solution: Use dynamic import withssr: false:
Issue: WASM Files Not Included in Build
Cause: WASM files inpublic/ aren’t automatically copied during build.
Solution:
WASM files in public/ are automatically included. Verify with:
Issue: Production Build Much Larger Than Expected
Cause: WASM files (particularly ffmpeg-core.wasm at 31MB) increase bundle size. Impact: This is expected. The WASM files are necessary for video processing. Optimization:- Use dynamic imports (already recommended)
- Lazy load video features only when needed
- Consider code splitting:
Environment-Specific Issues
Development vs Production Differences
Issue: Works in dev but fails in production. Common Causes:- Environment variables not set in production
- API URLs hardcoded to localhost
- CORS policies different in production
Issue: Memory Leaks During Development
Cause: Hot Module Replacement (HMR) doesn’t clean up WASM modules. Solution: Restart dev server periodically:Getting Help
If your issue isn’t covered here:- Check Browser Console: Most issues show detailed errors
- Check Network Tab: Look for failed requests (404s, CORS errors)
- Verify Setup: Follow integration guides step-by-step
- Example Project: Compare your code with the included example
- Support Portal: Contact your account manager or [email protected]
- Documentation: https://docs.distralabs.com
Providing Helpful Bug Reports
When reporting issues, include:- Next.js version (
npm list next) - React version (
npm list react) - SDK version (
npm list @distralabs/media-editor) - Full error message from console
- Network tab screenshot (if relevant)
- Minimal reproduction code
Quick Checklist
Before asking for help, verify:- Using Next.js 14.2.15 (not 15+)
- Using React 18.2.0 (not 19)
- SDK installed:
@distralabs/[email protected] - SDK CSS imported in globals.css
- Dynamic import with
ssr: falseused - WASM files copied to
public/folder - URL rewrites added to
next.config.js(if needed) - Dev server restarted after config changes
- Hard refreshed browser (Cmd+Shift+R)
- License key and API URL correct
- Backend server running (if using local API)
Version Compatibility Matrix
| Next.js | React | SDK | Status |
|---|---|---|---|
| 15.x | 19.x | 1.1.9 | ❌ Not Compatible |
| 14.2.x | 18.2 | 1.1.9 | ✅ Recommended |
| 14.0.x | 18.2 | 1.1.9 | ✅ Compatible |
| 13.x | 18.2 | 1.1.9 | ⚠️ Not Tested |
Last Updated: November 2025