Skip to content

"Can't resolve 'videojs'" error when building for production #300

Description

@lfrost

I have added the latest versions of Video.js and its YouTube plugin to an Ember 3.19 application.

yarn add --dev video.js
yarn add --dev videojs-youtube

It was working fine until I tried to do a production build (ember build -e production), when I get this error from ember-auto-import.

ERROR in ./node_modules/videojs-youtube/dist/Youtube.js
Module not found: Error: Can't resolve 'videojs' in '.../git/test-videojs-youtube/node_modules/videojs-youtube/dist'
 @ ./node_modules/videojs-youtube/dist/Youtube.js 32:4-34:6
 @ /tmp/broccoli-18605uM7OEtuWfsgR/cache-211-bundler/staging/app.js
 @ multi /tmp/broccoli-18605uM7OEtuWfsgR/cache-211-bundler/staging/l.js /tmp/broccoli-18605uM7OEtuWfsgR/cache-211-bundler/staging/app.js⠋ buildingcleaning up...
Build Error (Bundler)

webpack returned errors to ember-auto-import

I tried creating an empty Ember 3.19 application and adding nothing but these two modules, and a component to import them, and I get the same error. A complete error log is attached. One of the imports is "videojs", which the Ember application has no trouble finding.

If I just needed an alias, I would expect it to be needed for development and production. What is different about a production build that could cause this error?

Thanks.
error.dump.acd7611f90cfcf580dd9cb3ba76fbad7.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions