Skip to content

Importing into Next.js project triggers Module not found for @ffmpeg/core #14

@zinkkrysty

Description

@zinkkrysty

I'm trying to use canvas-record in a Next.js application. I don't need the ffmpeg encoder as I want to use the WebCodecs instead. Despite this, I get an ugly error regarding importing of ffmpeg-core module.

error - ./node_modules/canvas-record/node_modules/@ffmpeg/ffmpeg/src/browser/defaultOptions.js:7:0
Module not found: Can't resolve '/node_modules/@ffmpeg/core/dist/ffmpeg-core.js'

Import trace for requested module:
./node_modules/canvas-record/node_modules/@ffmpeg/ffmpeg/src/browser/index.js
./node_modules/canvas-record/node_modules/@ffmpeg/ffmpeg/src/index.js
./node_modules/canvas-record/src/encoders/FFmpegEncoder.js
./node_modules/canvas-record/src/encoders/index.js
./node_modules/canvas-record/index.js

There is a similar issue opened at ffmpegwasm/ffmpeg.wasm#383 however I don't expect canvas-record to import any encoders until I decide to use them.

I would appreciate the possibility of using this library without automatically loading the ffmpeg module.

Consider letting the user import the encoder they need and passing it to the Recorder initialization.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions