muxinc / videojs-mux-kit

MIT License
33 stars 11 forks source link

Error when importing into a react app (Next.js) #10

Closed dylanjha closed 3 years ago

dylanjha commented 3 years ago
  1. In this repo, run npm run build
  2. From your Next.js application, add this to package.json: "@mux/videojs-kit": "file:../videojs-mux-kit", (update the file:../ syntax to the correct directory where videojs-mux-kit is installed
  3. Import the library
import videojs from '@mux/videojs-kit';
import '@mux/videojs-kit/dist/index.css';

See error message:

videojs-kit-import-error_2021-03-31_22-38-50

When debugging I can see node_modules/@mux/videojs-kit is installed. The dist/index.js file exists and appears to compiled correctly.

I took a peak at webpack.config.js, I don't see any obvious mis-configurations, but this is also my first time looking at esbuild, so I don't quite understand if there are caveats.

Any ideas?

james-mux commented 3 years ago

This should now be solved by https://github.com/muxinc/videojs-mux-kit/pull/14