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

Unexpected token 'export' #543

Open
yeasin-2002 opened this issue Jan 10, 2024 · 4 comments
Open

Unexpected token 'export' #543

yeasin-2002 opened this issue Jan 10, 2024 · 4 comments

Comments

@yeasin-2002
Copy link

Describe the bug
In next.js (Client Component) it is throwing error on Build time.

Error Message:
export { default as a11yDark } from './a11y-dark';
SyntaxError: Unexpected token 'export'

Screenshots
image

Desktop (please complete the following information):

  • OS: windows 11
  • Browser : Brave
  • Version : latest
@maxpaleo
Copy link

Same thing here!

@yeasin-2002
Copy link
Author

I think this package is not compatible with nextjs or react 18+ version.

@LeandroJavierLaino
Copy link

@yeasin-2002 check this solution #230 (comment)

Basically you need change the import style from
react-syntax-highlighter/dist/esm/...
to
react-syntax-highlighter/dist/cjs/...

@18677664100
Copy link

@LeandroJavierLaino Thanks! It can work!

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

4 participants