-
-
Notifications
You must be signed in to change notification settings - Fork 174
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
Using next-remove-imports but still can't deploy - Next.js #224
Comments
Or before using the @BobinBieber |
|
// next.config.js
module.exports = {
// Prefer loading of ES Modules over CommonJS
experimental: { esmExternals: true }
} const removeImports = require('next-remove-imports')({})
module.exports = removeImports({
// Prefer loading of ES Modules over CommonJS
experimental: { esmExternals: true },
images: {
domains: [
'cdn.discordapp.com',
'discordapp.com',
]
}
}) |
@jaywcjlove I still get the same error |
@BobinBieber This error should go to Next.js to study it. |
@BobinBieber vercel/next.js#27876 |
Hi @MrPedrinho i got the same issue when i try to run it on dev mode then i try to import it with dynamic from import dynamic from 'next/dynamic'
const MDEditor = dynamic<MDEditorProps>(() => import('@uiw/react-md-editor').then(mod => mod.default), { ssr: false }) Then the error is gone. Maybe you can try this ? |
npm install next-remove-imports
npm install @uiw/react-md-editor@v3.6.0 // next.config.js
const removeImports = require('next-remove-imports')();
module.exports = removeImports({}); import "@uiw/react-md-editor/markdown-editor.css";
import "@uiw/react-markdown-preview/markdown.css";
import dynamic from "next/dynamic";
const MDEditor = dynamic(
() => import("@uiw/react-md-editor").then((mod) => mod.default),
{ ssr: false }
);
function HomePage() {
return (
<div>
<MDEditor value="**Hello world!!!**" />
</div>
);
}
export default HomePage; |
This solution worked great for me. But when I tried to apply custom toolbar with before ❌import { commands, MDEditorProps } from '@uiw/react-md-editor';
const MDEditor = dynamic<MDEditorProps>(() => import('@uiw/react-md-editor'), {
ssr: false,
});
function HomePage() {
return (
<div>
<MDEditor
value="**Hello world!!!**"
commands={[
commands.bold,
commands.italic,
]}
/>
</div>
);
}
export default HomePage; after ⭕import { MDEditorProps } from '@uiw/react-md-editor';
import { bold, italic } from '@uiw/react-md-editor/lib/commands';
const MDEditor = dynamic<MDEditorProps>(() => import('@uiw/react-md-editor'), {
ssr: false,
});
function HomePage() {
return (
<div>
<MDEditor
value="**Hello world!!!**"
commands={[
bold,
italic,
]}
/>
</div>
);
}
export default HomePage; |
Note that if you want to use const MarkdownPreview = dynamic(
() => import("@uiw/react-markdown-preview").then((mod) => mod.default),
{ ssr: false }
);
...
<MarkdownPreview source={content} className="mt-30" /> |
Example: @uiwjs/next-remove-imports/example |
When I try to deploy on Vercel with Next.js I always get this error
I already checked #52, used next-remove-imports but this happens.
This is my
next.config.js
And this how I'm importing react-md-editor
The text was updated successfully, but these errors were encountered: