Cannot find module 'next-video' or its corresponding type declarations #140
-
Following set up instructions but getting errors on both imports (module and video file) Marking yes for Typescript when installing, but getting these errors in my editor:
and
Unsure if its an error or if the installation instructions need tweaking? |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 1 reply
-
thanks for the feedback! does restarting the TS server in your editor fix it? I have a working example here https://github.com/luwes/next-video-app |
Beta Was this translation helpful? Give feedback.
-
@maxhart7. Set moduleResolution to "bundler" in your tsconfig.json file and restart your typescript server. {
"compilerOptions": {
"baseUrl": ".",
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler", // <--- Like this
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"paths": {
"@/*": ["./*"]
},
"plugins": [
{
"name": "next"
}
]
},
"include": [
"video.d.ts",
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
".next/types/**/*.ts",
"lint-staged.config.js"
],
"exclude": ["node_modules"]
} |
Beta Was this translation helpful? Give feedback.
-
I had the same issue and |
Beta Was this translation helpful? Give feedback.
-
I did get a follow up issue when trying to run my local dev server: If anyone else gets this, the |
Beta Was this translation helpful? Give feedback.
-
What should we do if setting the bundler option breaks something else? |
Beta Was this translation helpful? Give feedback.
@maxhart7. Set moduleResolution to "bundler" in your tsconfig.json file and restart your typescript server.