usage without typescript
This might not be an issue. I got errors to let me install types
Please provide the errors, so we can tell.
- I'm using next.js, without typescript.
- I have installed the package correctly.
- Here is the example code, I directly copied into
page.js
import AvatarEditor from 'react-avatar-editor';
const MyEditor = () => {
return (
<AvatarEditor
image="default_avatar.png"
width={250}
height={250}
border={50}
color={[255, 255, 255, 0.6]} // RGBA
scale={1.2}
rotate={0}
/>
);
};
export default MyEditor;
The error I got:
./node_modules/react-avatar-editor/src/index.ts
Module parse failed: Unexpected token (2:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| import React, {
> type TouchEventHandler,
| type CSSProperties,
| type MouseEventHandler,
It seems the package is not even imported. Not sure why, it'll great to get some help.
May I ask: what kind of webpack loader should I use? @mosch
Do you use v13.x? There might have been a mishap in the releases. It looks like NPM latest is on v14.0.0-beta5, but this is wrong (it should only be on the beta tag)
I've released v13.0.1 (which is the same as 13.0.0) so 13.0.1 should show as the latest version again. Can you try it with this?
(I also marked the mistagged version as deprecated)