Closed grempe closed 1 year ago
Hello @grempe!
You need to bump the version of react
and react-dom
to version >= 18. I made a test and the video player render occurred with success.
I will work on adjusting to try retrocompatibility to both versions of React (17 and 18).
Altough the player renders on the frontend, I got the same error with react-dom 18.2.0.
Server error
Attempted import error: 'VimeoPlayer' is not exported from 'reactjs-vimeo-player' (imported as 'VimeoPlayer').
Import trace for requested module: ./src/app/aula/Player.js Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
Check your code at Player.js:7. at Component at Lazy at div at main at InnerLayoutRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:226:11) at RedirectErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:72:9) at RedirectBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:80:11) at NotFoundBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/not-found-boundary.js:59:11) at LoadingBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:330:11) at ErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/error-boundary.js:105:11) at InnerScrollAndFocusHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:139:9) at ScrollAndFocusHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:213:11) at RenderFromTemplateContext (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/render-from-template-context.js:15:44) at Lazy at OuterLayoutRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:339:11) at Lazy at InnerLayoutRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:226:11) at RedirectErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:72:9) at RedirectBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:80:11) at NotFoundBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/not-found-boundary.js:59:11) at LoadingBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:330:11) at ErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/error-boundary.js:105:11) at InnerScrollAndFocusHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:139:9) at ScrollAndFocusHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:213:11) at RenderFromTemplateContext (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/render-from-template-context.js:15:44) at Lazy at OuterLayoutRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:339:11) at Lazy at body at html at RedirectErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:72:9) at RedirectBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:80:11) at NotFoundErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/not-found-boundary.js:51:9) at NotFoundBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/not-found-boundary.js:59:11) at ReactDevOverlay (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/react-dev-overlay/internal/ReactDevOverlay.js:66:9) at HotReload (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/react-dev-overlay/hot-reloader-client.js:277:11) at Router (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/app-router.js:86:11) at ErrorBoundaryHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/error-boundary.js:80:9) at ErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/error-boundary.js:105:11) at AppRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/app-router.js:361:13) at Lazy at Lazy at ServerComponentWrapper (/Users/martins/www/cursonextjs.com/node_modules/next/dist/server/app-render/create-server-components-renderer.js:78:31) at ServerComponentWrapper (/Users/martins/www/cursonextjs.com/node_modules/next/dist/server/app-render/create-server-components-renderer.js:78:31) at InsertedHTML (/Users/martins/www/cursonextjs.com/node_modules/next/dist/server/app-render/app-render.js:836:33)
- error Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
- warn ./src/app/aula/Player.js Attempted import error: 'VimeoPlayer' is not exported from 'reactjs-vimeo-player' (imported as 'VimeoPlayer').
Code
"use client";
import {VimeoPlayer} from "reactjs-vimeo-player";
import styles from 'reactjs-vimeo-player/dist/style.css';
export default function Component() {
return (
<VimeoPlayer id={822998068} autoplay={true} fullWidth={true}/>
)
}
Altough the player renders on the frontend, I got the same error with react-dom 18.2.0.
Server error
Attempted import error: 'VimeoPlayer' is not exported from 'reactjs-vimeo-player' (imported as 'VimeoPlayer'). Import trace for requested module: ./src/app/aula/Player.js Warning: React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check your code at Player.js:7. at Component at Lazy at div at main at InnerLayoutRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:226:11) at RedirectErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:72:9) at RedirectBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:80:11) at NotFoundBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/not-found-boundary.js:59:11) at LoadingBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:330:11) at ErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/error-boundary.js:105:11) at InnerScrollAndFocusHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:139:9) at ScrollAndFocusHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:213:11) at RenderFromTemplateContext (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/render-from-template-context.js:15:44) at Lazy at OuterLayoutRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:339:11) at Lazy at InnerLayoutRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:226:11) at RedirectErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:72:9) at RedirectBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:80:11) at NotFoundBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/not-found-boundary.js:59:11) at LoadingBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:330:11) at ErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/error-boundary.js:105:11) at InnerScrollAndFocusHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:139:9) at ScrollAndFocusHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:213:11) at RenderFromTemplateContext (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/render-from-template-context.js:15:44) at Lazy at OuterLayoutRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/layout-router.js:339:11) at Lazy at body at html at RedirectErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:72:9) at RedirectBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/redirect-boundary.js:80:11) at NotFoundErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/not-found-boundary.js:51:9) at NotFoundBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/not-found-boundary.js:59:11) at ReactDevOverlay (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/react-dev-overlay/internal/ReactDevOverlay.js:66:9) at HotReload (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/react-dev-overlay/hot-reloader-client.js:277:11) at Router (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/app-router.js:86:11) at ErrorBoundaryHandler (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/error-boundary.js:80:9) at ErrorBoundary (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/error-boundary.js:105:11) at AppRouter (webpack-internal:///(sc_client)/./node_modules/next/dist/client/components/app-router.js:361:13) at Lazy at Lazy at ServerComponentWrapper (/Users/martins/www/cursonextjs.com/node_modules/next/dist/server/app-render/create-server-components-renderer.js:78:31) at ServerComponentWrapper (/Users/martins/www/cursonextjs.com/node_modules/next/dist/server/app-render/create-server-components-renderer.js:78:31) at InsertedHTML (/Users/martins/www/cursonextjs.com/node_modules/next/dist/server/app-render/app-render.js:836:33)
- error Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
- warn ./src/app/aula/Player.js Attempted import error: 'VimeoPlayer' is not exported from 'reactjs-vimeo-player' (imported as 'VimeoPlayer').
Code
"use client"; import {VimeoPlayer} from "reactjs-vimeo-player"; import styles from 'reactjs-vimeo-player/dist/style.css'; export default function Component() { return ( <VimeoPlayer id={822998068} autoplay={true} fullWidth={true}/> ) }
@r-martins can you upload your code in code sandbox (https://codesandbox.io) and shared it with me? I need only basic structure.
The problem was closed because there was no interaction.
See stackblitz running example:
https://stackblitz.com/edit/nextjs-vngw87?file=pages/index.js
Shows in dev preview page:
and in dev console: