Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON #326

Closed
ChandanJal opened this issue Dec 21, 2024 · 4 comments
Closed

Comments

@ChandanJal
Copy link

Browser window keep showing this error

SyntaxError: Unexpected token '<', "<!DOCTYPE "... is not valid JSON
overrideMethod @ installHook.js:1
window.console.error @ app-index.js:33
console.error @ hydration-error-info.js:63
eval @ video-loader.js:34
await in eval
eval @ utils.js:41
tick @ utils.js:52
setInterval
eval @ utils.js:55
commitHookEffectListMount @ react-dom.development.js:21102
invokePassiveEffectMountInDEV @ react-dom.development.js:23980
invokeEffectsInDev @ react-dom.development.js:26852
legacyCommitDoubleInvokeEffectsInDEV @ react-dom.development.js:26835
commitDoubleInvokeEffectsInDEV @ react-dom.development.js:26816
flushPassiveEffectsImpl @ react-dom.development.js:26514
flushPassiveEffects @ react-dom.development.js:26438
commitRootImpl @ react-dom.development.js:26337
commitRoot @ react-dom.development.js:26077
performSyncWorkOnRoot @ react-dom.development.js:24925
flushSyncWorkAcrossRoots_impl @ react-dom.development.js:7758
flushSyncWorkOnAllRoots @ react-dom.development.js:7718
processRootScheduleInMicrotask @ react-dom.development.js:7863
eval @ react-dom.development.js:8034
GET http://localhost:3000/api/video?url=https://file_url_path/video.mp4 404 (Not Found)
@luwes
Copy link
Collaborator

luwes commented Dec 21, 2024

is next-video added in the next config? something like

import { withNextVideo } from 'next-video/process';

/** @type {import('next').NextConfig} */
const nextConfig = {};

export default withNextVideo(nextConfig);

do you have an API handler configured?
https://github.com/muxinc/next-video#remote-videos

dup issue
#278

@ChandanJal
Copy link
Author

ChandanJal commented Dec 23, 2024

Hi @luwes ,

I've added this line please check

import { withNextVideo } from "next-video/process";

/** @type {import('next').NextConfig} */
const nextConfig = {
  images: {
    remotePatterns: [
      {
        protocol: "https",
        hostname: "media.themoviedb.org",
      },
      {
        protocol: "https",
        hostname: "image.tmdb.org",
      },
    ],
  },
};

export default withNextVideo(nextConfig);

@ChandanJal
Copy link
Author

Did anyone found any solution ?

@luwes
Copy link
Collaborator

luwes commented Jan 10, 2025

@ChandanJal are you sure you want to process the video you're defining in the src attribute?

  1. yes, then you have to define a API handler to process the string source https://github.com/muxinc/next-video#remote-videos
  2. no, just want to play that source? then you need https://github.com/muxinc/next-video#player-only-demo

@muxinc muxinc locked and limited conversation to collaborators Jan 10, 2025
@luwes luwes converted this issue into discussion #331 Jan 10, 2025

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants