Open nicolasguasca1 opened 3 years ago
+1
I have the same problem and most likely it is related to this commit: https://github.com/vime-js/vime/commit/1e8f386a46df47e7bcef408ceb5e116ca9a513e8 (chore: migrate to lerna).
components
folder was moved, but index.ts
points to the old location:
https://github.com/vime-js/vime/blob/main/packages/react/src/index.ts
Really strange I need a reproduction that I can test. The components/
directory is auto-generated at build-time, that's why it's missing in GitHub explorer. You can see it exists here.
Generally looking at this error I'm assuming whatever you're bundling with is not checking .jsx
extensions?
If Rollup -> https://github.com/rollup/plugins/tree/master/packages/node-resolve#extensions If Webpack -> https://webpack.js.org/configuration/resolve/#resolveextensions
Thanks for the clarification. I'm using Next.js at the moment. Will try to prepare an example.
P.S.: Version 5.0.31
works just fine 🤔
Any news on this one?
I've tried different Webpack
configurations, gave up and stick with the 5.0.31
.
Here is a reproduction (basic Next.js setup + vime): https://github.com/shchekoldin/next-vime-issues-231
Steps:
npm install
npm run dev
http://localhost:3000
Error: Cannot find module './Audio'
errorBTW, looks like it doesn't work for Next.js SSR mode only.
Solved for me....
webpack.config.js
resolve: {
extensions: [".jsx", ".js", ".json", ".wasm"],
...
},
@lazaronixon I am getting the same issue as @shchekoldin on my Next.js project and can't do anything now for several weeks. Can you please provide full webpack.config.js
file and next.config.js
file? Now, I have only this code in next.config.js
module.exports = {
webpack(config) {
config.module.rules.push({
test: /\.svg$/,
use: ["@svgr/webpack"]
});
return config;
}
};
+1 for experiencing this on Next.js (12.0.2
, fresh install).
Here is my React component:
import { Player, Video as VideoFrame } from '@vime/react'
import '@vime/core/themes/default.css'
type VideoProps = { src: string; thumbnail?: string }
const Video = ({ src, thumbnail }: VideoProps) => {
return (
<Player controls>
<VideoFrame crossOrigin="" {...(thumbnail ? { poster: thumbnail } : {})}>
<source data-src={src} type="video/mp4" />
</VideoFrame>
</Player>
)
}
export default Video
if you don't need to load vime.js by server side. you can solve like this
import dynamic from "next/dynamic";
const VideoPlayer = dynamic<VideoPlayerProps>(
() => import("./vime").then((module) => module.VideoPlayer), { ssr: false }
);
Still having the same problem with "next": "^12.0.8", "react": "^17.0.2", "@vime/core": "^5.0.31", "@vime/react": "^5.0.31",
Tried 5.0.31 as [shchekoldin] said this version was working, but it's also not working
any plans on fixing this? having the same issue & doesn't work with adding:
resolve: {
extensions: ['.jsx', '.js', '.json', '.wasm'],
},
Same happened with me, This helped me: https://github.com/vime-js/vime/issues/109#issuecomment-1001207601
To day i had the same porblem and this is how i solved it :
1 - I crieted a component Called VideoPlayer that just implement and export de Vimeo video component. It will help me to change the video component more ease whenever i need.
2 - I imported my VideoPlayer component using the Nextjs's Dynamic import.
Support Question
I have entered the README example in my app and it did work but all of a sudden Im getting the following:
Here is the component I am trying to render:
And the function is still empty:
Any help will be much appreciated!