You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've encountered the same issue. It seems that the latest version of Next.js changes file paths during build. Here's a workaround:
const{ isServer, dev }=options;config.module.rules.push({test: /\.(mp4|webm|mov|ogg|swf|ogv)$/,use: [{loader: require.resolve('file-loader'),options: {publicPath: `${prefix||basePath}/_next/static/videos/`,// 🔥 Fix the relative path on production buildoutputPath: `${dev ? '' : '../'}${isServer ? '../' : ''}static/videos/`,name: '[name]-[hash].[ext]',},},],});
Alternatively, you can try using the next-file-loader I've just created. It's based on the official next-image-loader but generalized to support various asset types like video and audio. Here's an example:
it works fine in the local server as background image but after deployment it longer works. The video simply does not appears
The text was updated successfully, but these errors were encountered: