Can't build with Vite

This issue has been tracked since 2021-12-31.

When I do npm run build I get an error. I'm using Vite currently instead of CRA.

The render function looks fine instead index.js of react-email-editor, so I'm unsure why I'm getting this error.

image

OddBlueDog wrote this answer on 2022-01-26
✓ 267 modules transformed.
[commonjs] Unexpected token (24:6) in C:/Users/Tom/Documents/Projects/Helpappy/frontend/node_modules/react-email-editor/src/index.js
file: C:/Users/Tom/Documents/Projects/Helpappy/frontend/node_modules/react-email-editor/src/index.js:24:6
22:
23:     return (
24:       <div
          ^
25:         style={{
26:           flex: 1,
error during build:
SyntaxError: Unexpected token (24:6) in C:/Users/Tom/Documents/Projects/Helpappy/frontend/node_modules/react-email-editor/src/index.js
    at Parser.pp$5.raise (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:19547:13)
    at Parser.pp.unexpected (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:16872:8)
    at Parser.pp$4.parseExprAtom (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:18922:10)
    at Parser.pp$4.parseExprSubscripts (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:18714:19)
    at Parser.pp$4.parseMaybeUnary (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:18680:17)
    at Parser.pp$4.parseExprOps (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:18613:19)
    at Parser.pp$4.parseMaybeConditional (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:18596:19)
    at Parser.pp$4.parseMaybeAssign (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:18564:19)
    at Parser.pp$4.parseParenAndDistinguishExpression (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:19018:28)
    at Parser.pp$4.parseExprAtom (C:\Users\Tom\Documents\Projects\Helpappy\frontend\node_modules\rollup\dist\shared\rollup.js:18881:41)```
ayushmxn wrote this answer on 2022-01-26

Recently ran into this issue myself (my setup is CRA though). This means your bundler doesn't understand JSX syntax. My workaround was exposing the lib directory instead of downloading the relevant babel plugins.

More Details About Repo
Owner Name unlayer
Repo Name react-email-editor
Full Name unlayer/react-email-editor
Language JavaScript
Created Date 2017-10-01
Updated Date 2022-12-05
Star Count 3598
Watcher Count 48
Fork Count 627
Issue Count 163

YOU MAY BE INTERESTED

Issue Title Created Date Updated Date