megahertz / react-simple-wysiwyg

Simple and lightweight React WYSIWYG editor
https://megahertz.github.io/react-simple-wysiwyg/
MIT License
119 stars 21 forks source link

Failed to parse source map #10

Closed T-Nagui closed 2 years ago

T-Nagui commented 2 years ago

file: Error: ENOENT: no such file or directory, open '/home/xxxx/node_modules/react-simple-wysiwyg/src/ContentEditable.tsx'

Failed to parse source map

megahertz commented 2 years ago

Try to install the latest version 2.0.0-alpha.4

T-Nagui commented 2 years ago

thank's for your response :) but i have this error :

Compiled with problems:X

ERROR in ./src/components/form/wysiwyg/index.js 42:39-52

export 'DefaultEditor' (imported as 'DefaultEditor') was not found in 'react-simple-wysiwyg' (module has no exports)

ERROR in ./node_modules/react-simple-wysiwyg/lib/index.js 1:0-25

Module not found: Error: Can't resolve './editor' in '/home/neji/xxx/xxx/node_modules/react-simple-wysiwyg/lib' Did you mean 'index.js'? BREAKING CHANGE: The request './editor' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.

ERROR in ./node_modules/react-simple-wysiwyg/lib/index.js 2:0-26

Module not found: Error: Can't resolve './toolbar' in '/home/xxx/node_modules/react-simple-wysiwyg/lib' Did you mean 'index.js'? BREAKING CHANGE: The request './toolbar' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request.


==> version 2.0.0-alpha.4 I think i w'll stay with old version until this version become stable :) keep the Good work ;)

megahertz commented 2 years ago

I've published the final 2.0.0. Does it work? If no, could you help me reproduce the environment which has the issue?

T-Nagui commented 2 years ago

hi, @megahertz thank's for your reactivity ;) i just installed the new version and still this erros but i think it's just a quick fix : ERROR in ./src/components/form/wysiwyg/index.js 42:39-52 export 'DefaultEditor' (imported as 'DefaultEditor') was not found in 'react-simple-wysiwyg' (module has no exports)

ERROR in ./node_modules/react-simple-wysiwyg/lib/index.js 1:0-25 Module not found: Error: Can't resolve './editor' in '/home/neji/nvisionProjects/aAnda/intranet-client-app/node_modules/react-simple-wysiwyg/lib' Did you mean 'index.js'? BREAKING CHANGE: The request './editor' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request. @ ./src/components/form/wysiwyg/index.js 6:0-53 42:39-52

ERROR in ./node_modules/react-simple-wysiwyg/lib/index.js 2:0-26 Module not found: Error: Can't resolve './toolbar' in '/home/neji/nvisionProjects/aAnda/intranet-client-app/node_modules/react-simple-wysiwyg/lib' Did you mean 'index.js'?

BREAKING CHANGE: The request './toolbar' failed to resolve only because it was resolved as fully specified (probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '.mjs' file, or a '.js' file where the package.json contains '"type": "module"'). The extension in the request is mandatory for it to be fully specified. Add the extension to the request. @ ./src/components/form/wysiwyg/index.js 6:0-53 42:39-52

and this is my component : `import React from 'react'; import { TextField, Grid, Box, FormControl } from '@material-ui/core'; import { DefaultEditor } from 'react-simple-wysiwyg';

export default function MyEditor({ defaultValue, lg, handleChange, toEdit }) { const onChange = (e) => { handleChange((prev) => ({ ...prev,

    ...prev[lg],
    [toEdit]: e.target.value,
  },
}));

};

return ( < Grid container spacing={3} alignItems='flex-start' m={5}> < Box textAlign='right' m={3}> {lg.toUpperCase()} < Grid item md={10}> < FormControl fullWidth> < DefaultEditor value={defaultValue} onChange={onChange} /> </ Grid> </ Grid> ); }`

React 17.0.2

megahertz commented 2 years ago

I think now it's solved in v2.0.1

T-Nagui commented 2 years ago

ok i w'll wait for package publishing https://www.npmjs.com/package/react-simple-wysiwyg to test

megahertz commented 2 years ago

done

T-Nagui commented 2 years ago

one last bug sorry : react-simple-wysiwyg/lib/styles.css doesn't exist

megahertz commented 2 years ago

Thank you for testing. Now I compile ES module to a single file, so I think it should solve the issue.

T-Nagui commented 2 years ago

thank's it work :) if i find some time i w'll make some changes to it also