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

build error using nextjs15 #17896

Closed
babotaemin opened this issue Feb 10, 2025 · 6 comments
Closed

build error using nextjs15 #17896

babotaemin opened this issue Feb 10, 2025 · 6 comments
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). type:bug This issue reports a buggy (incorrect) behavior.

Comments

@babotaemin
Copy link

Reproduction steps

  1. Copied the editor React code from the builder.
  2. Set up the binding since the two-way binding wasn’t working.
  3. The binding worked when I added the data property.
  4. However, when this is done, there is a red underline in the cursor editor, and the build fails during the build process.

ckeditor5-code.txt

Current behavior

No response

Expected behavior

No response

Definition of Done

  • Please leave this field for us. We will fill it during the backlog refinement session.

Relevant debug data

Other details

No response

User agent

web (chrome)

@babotaemin babotaemin added squad:platform Issue to be handled by the Platform team. type:bug This issue reports a buggy (incorrect) behavior. labels Feb 10, 2025
@pomek pomek removed the squad:platform Issue to be handled by the Platform team. label Feb 10, 2025
@Mati365
Copy link
Member

Mati365 commented Feb 10, 2025

Probably fixed in ckeditor/ckeditor5-react@2a7d015

@babotaemin
Copy link
Author

Image

The redline is still appearing in the data section, and the build fails when running next build.
How should I fix this

@Mati365
Copy link
Member

Mati365 commented Feb 12, 2025

@babotaemin Consider checking v9.5.0-alpha.0 version.

@babotaemin
Copy link
Author

@Mati365 I appreciate your support. The redline issue in the data section disappeared when I set the version to v9.5.0-alpha.0.
However, when building in Next.js 15, I encounter the error: e.createElement is not a function.
Could this be due to SSR? What modifications should be made to ensure it works for everyone?
I have attached the source code for reference.
Thank you.

final_code.txt

@Mati365
Copy link
Member

Mati365 commented Feb 12, 2025

@babotaemin

I appreciate your support. The redline issue in the data section disappeared when I set the version to v9.5.0-alpha.0.

Glad to hear that, cool!

Could this be due to SSR? What modifications should be made to ensure it works for everyone?

The editor currently doesn’t support SSR. It should only be rendered after the component has mounted on the client side. You can achieve this using useEffect and dynamic import. Something like this:

import dynamic from 'next/dynamic';
import { useEffect, useState } from 'react';

const Editor = dynamic(() => import('your-editor-component'), { ssr: false });

export default function Page() {
  const [mounted, setMounted] = useState(false);

  useEffect(() => {
    setMounted(true);
  }, []);

  return <>{mounted && <Editor />}</>;
}

@babotaemin
Copy link
Author

@Mati365 , thank you so much! Have a wonderful day! 😊

@Witoso Witoso added the resolution:resolved This issue was already resolved (e.g. by another ticket). label Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
resolution:resolved This issue was already resolved (e.g. by another ticket). type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

4 participants