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

Trying to create tables gives an error TypeError: this.setData() is not a function #577

Open
seyone22 opened this issue Sep 30, 2023 · 2 comments

Comments

@seyone22
Copy link

Unhandled Runtime Error

TypeError: this.setData is not a function
Call Stack
enterTable
node_modules\mdast-util-gfm-table\lib\index.js (76:0)
compile
node_modules\remark-parse\node_modules\mdast-util-from-markdown\dev\lib\index.js (345:0)
fromMarkdown
node_modules\remark-parse\node_modules\mdast-util-from-markdown\dev\lib\index.js (177:0)
parser
node_modules\remark-parse\lib\index.js (33:23)
parse
node_modules\unified\lib\index.js (668:0)
ReactMarkdown
node_modules\react-markdown\lib\react-markdown.js (106:0)
renderWithHooks
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (10697:0)
updateFunctionComponent
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (15180:0)
beginWork$1
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (17324:0)
beginWork
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (25689:0)
performUnitOfWork
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (24540:0)
workLoopSync
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (24256:0)
renderRootSync
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (24211:0)
recoverFromConcurrentError
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (23446:0)
performSyncWorkOnRoot
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (23707:0)
flushSyncWorkAcrossRoots_impl
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (9970:0)
flushSyncWorkOnAllRoots
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (9928:0)
flushSync$1
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (23807:0)
finishEventHandler
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (27582:0)
batchedUpdates
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (27600:0)
dispatchEventForPluginEventSystem
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (30880:0)
dispatchEvent
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (28653:0)
dispatchDiscreteEvent
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (28624:0)
EventListener.handleEvent*addEventBubbleListener
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (28873:0)
addTrappedEventListener
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (30784:0)
listenToNativeEvent
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (30723:0)
listenToAllSupportedEvents/<
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (30734:0)
listenToAllSupportedEvents
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (30729:0)
hydrateRoot$1
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (36186:0)
hydrateRoot
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (36585:0)
exports.hydrateRoot
node_modules\next\dist\compiled\react-dom\client.js (20:0)
Next.js
startTransition
node_modules\next\dist\compiled\react\cjs\react.development.js (2664:0)
Next.js
(app-client)/./node_modules/next/dist/client/app-next-dev.js
file:/C:/Users/SGSey/WebstormProjects/papers/.next/static/chunks/main-app.js (94:1)
options.factory
/_next/static/chunks/webpack.js (716:31)
__webpack_require__
file:/C:/Users/SGSey/WebstormProjects/papers/.next/static/chunks/webpack.js (37:33)
__webpack_exec__
/_next/static/chunks/main-app.js (1669:61)
<unknown>
file:/C:/Users/SGSey/WebstormProjects/papers/.next/static/chunks/main-app.js (1670:147)
<unknown>
webpackJsonpCallback@http://localhost:3000/_next/static/chunks/webpack.js (1388:46)
<unknown>
/_next/static/chunks/main-app.js (9:61)

Running within a nextjs environment.

@jaywcjlove
Copy link
Member

I can't reproduce your error. You can provide an example of a reproducible error. @seyone22

@jaywcjlove
Copy link
Member

'use client';
import dynamic from 'next/dynamic';
import React from 'react';
import styles from './page.module.css';
import type { ContextStore } from '@uiw/react-md-editor';
const MDEditor = dynamic(() => import('@uiw/react-md-editor'), { ssr: false });
type OnChange = (value?: string, event?: React.ChangeEvent<HTMLTextAreaElement>, state?: ContextStore) => void;
export default function Home() {
const [value, setValue] = React.useState('**Hello world!!!**');
const onChange = React.useCallback<OnChange>((val) => {
setValue(val || '');
}, []);
return (
<main className={styles.main}>
<MDEditor style={{ width: '100%' }} value={value} onChange={onChange} />
</main>
);
}

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

2 participants