vime-js / vime

Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
https://vimejs.com
MIT License
2.75k stars 154 forks source link

Error: Cannot find module './Audio' NextJs #343

Closed jsonpreet closed 1 year ago

jsonpreet commented 1 year ago

image

Here I am getting this issue suddenly, Last night it was working fine.

Here what i am using:

"next": "13.0.2",
"@vime/core": "5.4.0",
"@vime/react": "5.4.0",
"react": "18.2.0",
const nextConfig = {
  reactStrictMode: false,
  swcMinify: true,
  experimental: {
    scrollRestoration: true
  },
  resolve: {
    extensions: ['.jsx', '.js', '.json', '.wasm'],
  },
  images: {
    minimumCacheTTL: 360,
    deviceSizes: [96, 128, 256, 384, 512, 640, 750, 828, 1080, 1200, 1920, 2048, 3840],
    imageSizes: [16, 32, 48, 64],
    remotePatterns: [
      {
        protocol: "https",
        hostname: "**",
      },
    ],
  },
}

module.exports = nextConfig
jsonpreet commented 1 year ago

solved

nodgear commented 1 year ago

solved

You should tell us how you solved...

ahmetskilinc commented 1 year ago

Would like to know how this was solved.

leighkendell commented 1 year ago

Better late than never? For me I was able to resolve this issue by adding '@vime/react' to the transpilePackages option in next.config: https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages @nodgear @ahmetskilinc

nodgear commented 1 year ago

Better late than never? For me I was able to resolve this issue by adding '@vime/react' to the transpilePackages option in next.config: https://nextjs.org/docs/app/api-reference/next-config-js/transpilePackages @nodgear @ahmetskilinc

i recommend migrating to vidstack. the api is literally amazing.

papitodev commented 1 year ago

Solution:

/* @type {import('next').NextConfig} / const nextConfig = { reactStrictMode: true, transpilePackages: ['@vime/react'], }

module.exports = nextConfig