create-guten-block icon indicating copy to clipboard operation
create-guten-block copied to clipboard

You may need an appropriate loader to handle this file type.

Open strarsis opened this issue 6 years ago • 1 comments

A react component (KenburnsEditor) causes a build error when imported in the gutenblock:

import { KenburnsEditor } from 'kenburns-editor';

A fork (forked off from gre) has to be used currently:

yarn add github:strarsis/kenburns-editor
yarn build
./node_modules/kenburns-editor/src/KenburnsEditor.js
Module parse failed: Unexpected token (310:13)
You may need an appropriate loader to handle this file type.
|     if (!innerRect) {
|       return <div style={styles} />;
|     }

strarsis avatar Sep 10 '18 23:09 strarsis

I believe the issue may be related to the presets being used for babel loader - we are including the env preset but not the react one as far as I can see.

Have you tried ejecting in a separate branch (npm run eject) and adjusting any of the config?

You would probably need to run npm install @babel/preset-react and then add "react" to the babel.presets array in your package.json. Then try to build.

brianjohnhanna avatar Sep 25 '18 20:09 brianjohnhanna