You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Jodit React Version: 4.1.2 Browser: All OS: Max/Linux Is React App: True
Code
I encounter the following error when trying to import into my typescript/webpacker project:
Wabpack version: 4.46.0
ERROR in ./app/javascript/components/application/halda-design-system/inputs/ControlledWysiwygWithLabel.tsx 84:38-49
"export 'default' (imported as 'JoditEditor') was not found in 'jodit-react'
at HarmonyImportSpecifierDependency._getErrors (/Users/jonny/ws/round-robin/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/jonny/ws/round-robin/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/jonny/ws/round-robin/node_modules/webpack/lib/Compilation.js:1463:22)
at /Users/jonny/ws/round-robin/node_modules/webpack/lib/Compilation.js:1258:10
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/jonny/ws/round-robin/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
at AsyncSeriesHook.lazyCompileHook (/Users/jonny/ws/round-robin/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/jonny/ws/round-robin/node_modules/webpack/lib/Compilation.js:1253:28)
at /Users/jonny/ws/round-robin/node_modules/webpack/lib/Compiler.js:672:17
at _done (eval at create (/Users/jonny/ws/round-robin/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at eval (eval at create (/Users/jonny/ws/round-robin/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:80:22)
importReact,{ReactElement,useState,useRef}from'react';import{useController}from'react-hook-form';importModalWrapperfrom'../../shared/modals/ModalWrapper';importJoditEditorfrom'jodit-react';interfaceControlledWysiwygWithLabelProps{id: string;labelClass?: string;labelText?: string;sublabelHtml?: string;init?: any;formInputName: string;formControl: any;defaultValue: any;inputRef?: any;onClick?: ()=>void;onFocus?: ()=>void;onBlur?: (e: unknown)=>void}constControlledWysiwygWithLabel=({
id,
labelClass ='block text-sm font-medium text-gray-700',
labelText,
sublabelHtml,
init ={},
formInputName,
formControl,
defaultValue,
inputRef,
onClick,
onFocus,
onBlur,}: ControlledWysiwygWithLabelProps): ReactElement=>{const{field: { onChange, value }}=useController({name: formInputName,control: formControl,
defaultValue,});consteditor=useRef(null);constconfig={readonly: false// all options from https://xdsoft.net/jodit/doc/}consthandleEditorChange=(newValue: string)=>{onChange(newValue);if(inputRef&&typeofinputRef.current!=='undefined'&&inputRef.current!==null){inputRef.current.value=newValue;}};// const [isFullScreen, setIsFullScreen] = useState(false);return(<>{labelText&&(<><labelhtmlFor={formInputName}className={labelClass}>{labelText}</label></>)}{sublabelHtml&&(<divclassName="py-2 text-xs italic text-gray-500">{sublabelHtml}</div>
)}<divclassName="mt-1"><JoditEditorref={editor}value={value}config={config}onBlur={handleEditorChange}// preferred to use only this option to update the content for performance reasonsonChange={handleEditorChange}/></div></>);};exportdefaultControlledWysiwygWithLabel;
Expected behavior:
Imports and is usable
Actual behavior:
Seems to import fine from the ide (vscode) perspective, but as I run webpacker, I get the following error:
ERROR in ./app/javascript/components/application/halda-design-system/inputs/ControlledWysiwygWithLabel.tsx 84:38-49
"export 'default' (imported as 'JoditEditor') was not found in 'jodit-react'
at HarmonyImportSpecifierDependency._getErrors (/Users/jonny/ws/round-robin/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:109:11)
at HarmonyImportSpecifierDependency.getErrors (/Users/jonny/ws/round-robin/node_modules/webpack/lib/dependencies/HarmonyImportSpecifierDependency.js:68:16)
at Compilation.reportDependencyErrorsAndWarnings (/Users/jonny/ws/round-robin/node_modules/webpack/lib/Compilation.js:1463:22)
at /Users/jonny/ws/round-robin/node_modules/webpack/lib/Compilation.js:1258:10
at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/jonny/ws/round-robin/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:15:1)
at AsyncSeriesHook.lazyCompileHook (/Users/jonny/ws/round-robin/node_modules/tapable/lib/Hook.js:154:20)
at Compilation.finish (/Users/jonny/ws/round-robin/node_modules/webpack/lib/Compilation.js:1253:28)
at /Users/jonny/ws/round-robin/node_modules/webpack/lib/Compiler.js:672:17
at _done (eval at create (/Users/jonny/ws/round-robin/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:9:1)
at eval (eval at create (/Users/jonny/ws/round-robin/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:80:22)
ℹ 「wdm」: Failed to compile.
The text was updated successfully, but these errors were encountered:
In Next.js app the solution is
import dynamic from 'next/dynamic';
and inside the function
const JoditEditor = dynamic(() => import('jodit-react'), { ssr: false });
Jodit React Version: 4.1.2
Browser: All
OS: Max/Linux
Is React App: True
Code
I encounter the following error when trying to import into my typescript/webpacker project:
Wabpack version: 4.46.0
Expected behavior:
Imports and is usable
Actual behavior:
Seems to import fine from the ide (vscode) perspective, but as I run webpacker, I get the following error:
The text was updated successfully, but these errors were encountered: