Skip to content
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

TypeError: Object prototype may only be an Object or null: undefined #796

Closed
Sagarshivalingappaathani opened this issue Oct 16, 2023 · 4 comments

Comments

@Sagarshivalingappaathani

import React from 'react'
import Split from 'react-split';
import '../../styles/global.css';

type Props = {}

const workSpace = (props: Props) => {
return (

1

2


)
}

export default workSpace

when i am using Split in Typescript it is giving the error as

⨯ node_modules\react-split\dist\react-split.js (23:40) @ create
⨯ TypeError: Object prototype may only be an Object or null: undefined
at Function.create ()
at eval (webpack-internal:///(rsc)/./node_modules/react-split/dist/react-split.js:24:41)
at eval (webpack-internal:///(rsc)/./node_modules/react-split/dist/react-split.js:175:6)
at eval (webpack-internal:///(rsc)/./node_modules/react-split/dist/react-split.js:3:30)
at eval (webpack-internal:///(rsc)/./node_modules/react-split/dist/react-split.js:4:3)
at (rsc)/./node_modules/react-split/dist/react-split.js (C:\Users\sagar\OneDrive\Desktop\letsCode SLP\letscode.next\server\vendor-chunks\react-split.js:20:1)
at webpack_require (C:\Users\sagar\OneDrive\Desktop\letsCode SLP\letscode.next\server\webpack-runtime.js:33:42)
at eval (webpack-internal:///(rsc)/./components/Workspace/Workspace.tsx:9:69)
at (rsc)/./components/Workspace/Workspace.tsx (C:\Users\sagar\OneDrive\Desktop\letsCode SLP\letscode.next\server\app\problems[id]\page.js:323:1)
at webpack_require (C:\Users\sagar\OneDrive\Desktop\letsCode SLP\letscode.next\server\webpack-runtime.js:33:42) {
type: 'TypeError',
page: '/problems/two-sum'
}
null

@M-Sanjay12o52o
Copy link

have you resolved this??

@Sagarshivalingappaathani
Copy link
Author

import React from 'react';
import Split from 'react-split';
import '../../styles/global.css';

const workSpace = (props: Props) => {
return (
<>







</>
);

};

export default workSpace;

this worked for me

if still not if you are using next.js add "use client"; at the top of the file

@cliftonlabrum
Copy link

Adding 'use client'; fixed it for me.

@amineazizix
Copy link

Adding use client directive fixed it for me too. Thanks @cliftonlabrum

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants