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

[Bug] use @milkdown/react got error with React 19 (Next 15.1.5) ? #1637

Open
2 tasks done
HAHAHA44 opened this issue Jan 22, 2025 · 0 comments
Open
2 tasks done

[Bug] use @milkdown/react got error with React 19 (Next 15.1.5) ? #1637

HAHAHA44 opened this issue Jan 22, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@HAHAHA44
Copy link

Initial checklist

  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything (or linked relevant results below)

Affected packages and versions

7.6.1

Link to runnable example

No response

Steps to reproduce

I used the demo on the official website.

import React from "react";
import { Editor, rootCtx } from "@milkdown/kit/core";
import { nord } from "@milkdown/theme-nord";
import { Milkdown, MilkdownProvider, useEditor } from "@milkdown/react";
import { commonmark } from "@milkdown/kit/preset/commonmark";

const MilkdownEditor: React.FC = () => {
  const { get } = useEditor((root) =>
    Editor.make()
      .config(nord)
      .config((ctx) => {
        ctx.set(rootCtx, root);
      })
      .use(commonmark)
  );

  return <Milkdown />;
};

export const MilkdownEditorWrapper: React.FC = () => {
  return (
    <MilkdownProvider>
      <MilkdownEditor />
    </MilkdownProvider>
  );
};

Expected behavior

The demo could be run successfully.

Actual behavior

I got this Error:

TypeError: (0 , {imported module [project]/nodemodules/.pnpm/[email protected]@[email protected][email protected]/nodemodules/next/dist/server/route-modules/app-page/vendored/rsc/react.js [app-rsc] (ecmascript)}.createContext) is not a function

Runtime

Chrome

OS

Windows

Build and bundle tools

Vite

@HAHAHA44 HAHAHA44 added the bug Something isn't working label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants