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

NextJS Version 13.5 brokes #381

Open
jspasiuk opened this issue Oct 13, 2023 · 5 comments
Open

NextJS Version 13.5 brokes #381

jspasiuk opened this issue Oct 13, 2023 · 5 comments

Comments

@jspasiuk
Copy link

jspasiuk commented Oct 13, 2023

We just updated NextJS to the latest version (13.5) from 13.4 and froala started crashed (some type issue)

import "froala-editor/css/froala_style.min.css";
import "froala-editor/css/froala_editor.pkgd.min.css";
import FroalaEditorComponent from "react-froala-wysiwyg";
import "froala-editor/js/plugins/font_size.min.js";
import "froala-editor/js/plugins/align.min.js";
import config from "../../../config";

export default function CustomTextEditor({
  initialValue,
  setProp,
}: {
  initialValue: string;
  setProp: any;
}) {
  return (
    <FroalaEditorComponent
      config={{
        key: config.FROALA_KEY,
        initOnClick: true,
        disableRightClick: true,
        toolbarInline: true,
        charCounterCount: false,
        toolbarVisibleWithoutSelection: true,
        reactIgnoreAttrs: ["class", "id"],
        htmlAllowedTags: ["p"],
      }}
      onModelChange={(model: any) => {
        setProp((props: any) => (props.initialValue = model));
      }}
      tag="div"
      model={initialValue}
    />
  );
}

This is our code, and we import the editor using

const CustomTextEditor = dynamic(() => import("./CustomTextEditor.component"), { ssr: false, });

Thanks

@TylerNRobertson
Copy link

+1 on this, same for me in our project as well

@TylerNRobertson
Copy link

Seems to only happen in a production optimized build, in development mode it works fine

@Luyin
Copy link

Luyin commented Oct 20, 2023

It's works on NextJS v13.4... hmm

@TylerNRobertson
Copy link

@Luyin Yeah this issue is for 13.5, its weird cus it works in 13.5.3 but not any minor version after that

@ilyaskarim
Copy link

We just updated NextJS to the latest version (13.5) from 13.4 and froala started crashed (some type issue)

import "froala-editor/css/froala_style.min.css";
import "froala-editor/css/froala_editor.pkgd.min.css";
import FroalaEditorComponent from "react-froala-wysiwyg";
import "froala-editor/js/plugins/font_size.min.js";
import "froala-editor/js/plugins/align.min.js";
import config from "../../../config";

export default function CustomTextEditor({
  initialValue,
  setProp,
}: {
  initialValue: string;
  setProp: any;
}) {
  return (
    <FroalaEditorComponent
      config={{
        key: config.FROALA_KEY,
        initOnClick: true,
        disableRightClick: true,
        toolbarInline: true,
        charCounterCount: false,
        toolbarVisibleWithoutSelection: true,
        reactIgnoreAttrs: ["class", "id"],
        htmlAllowedTags: ["p"],
      }}
      onModelChange={(model: any) => {
        setProp((props: any) => (props.initialValue = model));
      }}
      tag="div"
      model={initialValue}
    />
  );
}

This is our code, and we import the editor using

const CustomTextEditor = dynamic(() => import("./CustomTextEditor.component"), { ssr: false, });

Thanks

Can we get more details about the error you're encountering? Additionally, we've made enhancements to our Type definitions, so you might want to try our latest version to see if it resolves the issue.

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

4 participants