-
Notifications
You must be signed in to change notification settings - Fork 46
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
Could not work with nextjs v13 appdir #105
Comments
|
Maybe it's not 'use client' cause this issue. And, there is a warning
this is my test code src/app/page.tsx 'use client';
import { MdEditor } from 'md-editor-rt';
import 'md-editor-rt/lib/style.css';
import { useState } from 'react';
import styles from '../styles/Home.module.css';
export default function Page() {
const [text, setText] = useState('# md-editor-v3');
return (
<div className={styles.container}>
<main className={styles.main}>
<h1 className={styles.title}>
Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>
<p className={styles.description}>
Get started by editing <code className={styles.code}>pages/index.js</code>
</p>
<MdEditor modelValue={text} onChange={setText} />
</main>
</div>
);
} I just change the example code, and using with next@latest and react@latest |
这个问题的原因我找到并且验证了,但我没找到最优美的解决办法。@imzbf 能否给出更好的解决办法呢?原因如下: |
这里确实有个问题,作者没注意到,它在正常的单页应用中没有影响,但是在next中有问题,我尝试修复看看 不过我刚刚没有能还原你这边报错的问题,可能需要这边修复后通过测试版这边协助验证一下 |
https://github.com/taoqf/test-md-editor-rt |
我忘记我的next13环境解决过这个问题了,所以没复现,这个问题是因为动态的import导致的,需要对next进行一点配置 next.config.js /** @type {import('next').NextConfig} */
const nextConfig = {
webpack: (config, { isServer }) => {
if (!isServer) {
config.resolve = {
...config.resolve,
fallback: {
...config.resolve.fallback,
fs: false,
},
};
}
config.module = {
...config.module,
exprContextCritical: false,
};
return config;
},
};
module.exports = nextConfig; |
另外,我在 pnpm i md-editor-rt@beta |
Latest version has been released |
encountered an issue with the page simply refusing to load after the build
|
描述这个Bug
could not preview mermaid.
版本号
nodejs v18 nextjs v13
问题重现链接
No response
The text was updated successfully, but these errors were encountered: