muxinc / next-video

The easiest way to add video in your Nextjs app.
https://next-video.dev
MIT License
853 stars 32 forks source link

TypeScript does not recognize the types for the next video. #258

Closed isrezaei closed 5 months ago

isrezaei commented 6 months ago

When I imported the next-video package in my component, I got an error that said S2307: Cannot find module 'next-video' or its corresponding type declarations. How can I fix that? I installed the package according to the document.

My problems Screenshot 2024-05-26 183905

Also In the console log, I received many 404 errors! I don't know why I got this error after playing the video! Screenshot 2024-05-26 183944

luwes commented 5 months ago

@isrezaei are you still running into this issue? it's possible you might need to restart the TS server in VS code.

if you want to use string video sources which don't need uploading you can use the player export added in v1.1.0

example: https://next-video-demo.vercel.app/player-only https://github.com/muxinc/next-video/blob/main/examples/default-provider/app/(default)/player-only/page.tsx

pedroviniciusn commented 5 months ago

Hello @isrezaei, did you manage to solve it? I have the same error, and I'm not finding a solution, even redoing all the steps in the documentation.

image

pedroviniciusn commented 5 months ago

Well, I just solved it, I just had to put tsconfig's moduleResolution as bundler and then it worked, I still don't know if this could break other things in my project, I hope not.

luwes commented 5 months ago

yes, that's nextjs default nowadays. "moduleResolution": "bundler",

thanks for following up here!