Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I am not able install in next js. It shows "SyntaxError: Unexpected token 'export'" #290

Open
2 of 3 tasks
shyamk91 opened this issue Dec 9, 2021 · 6 comments
Open
2 of 3 tasks

Comments

@shyamk91
Copy link

shyamk91 commented Dec 9, 2021

Checklist

Description

Write here your issue description.

@shyamk91
Copy link
Author

shyamk91 commented Dec 9, 2021

I am not able install in next js. It shows "SyntaxError: Unexpected token 'export

@shyamk91 shyamk91 closed this as completed Dec 9, 2021
@shyamk91 shyamk91 reopened this Dec 9, 2021
@paradoxkb
Copy link

Same issue with same conditions

@chrishj59
Copy link

chrishj59 commented Dec 21, 2021

I have the same issue. I notice the message in the console:
(node:90881) [DEP0128] DeprecationWarning: Invalid 'main' field in '.../Documents/Dev/SocialNetwork/sh_client/node_modules/mui-rte/package.json' of 'dist/index.js'. Please either fix that or report it to the module author
I am running Intel mac :
OS Monterey 12.0.1
"@emotion/react": "^11.7.1",
"@emotion/styled": "^11.6.0",
"@mui/icons-material": "^5.2.5",
"@mui/lab": "^5.0.0-alpha.60",
"@mui/material": "^5.2.5",
"@mui/styles": "^5.2.3",
"mui-rte": "^2.0.0",
"next": "^12.0.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",

mui-rte version 1.29 seems to work so the issue seems to be with V2

@oseh-stake
Copy link

oseh-stake commented Dec 24, 2021

hi @chrishj59 @paradoxkb @shyamk91 and others

This issue can be resolved by finding the mui-rte folder in node_modules

and updating the default export in index.js to module.exports = require('./dist/MUIRichTextEditor')

I have made a PR for this here
#292

@csmcallister
Copy link

Is this project still maintained? It's been months since the last commit and #292 is still open.

@slaat
Copy link

slaat commented Mar 7, 2022

import dynamic from 'next/dynamic'

const MUIRichTextEditor = dynamic(() => import('mui-rte'), { ssr: false });

you can use dynamic to work around that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants