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

SyntaxError: Unexpected token 'export' #7

Open
prajwalkulkarni opened this issue Jun 15, 2022 · 5 comments
Open

SyntaxError: Unexpected token 'export' #7

prajwalkulkarni opened this issue Jun 15, 2022 · 5 comments

Comments

@prajwalkulkarni
Copy link

Describe the bug
After adding the Xterm component and firing up the server, I'm being shown this error on a NextJS project. I'm not really sure if there are any other additional configurations to be made in order to render this component properly. If there is, I feel the README section can be improved so that new-users don't face the same issue.

SyntaxError: Unexpected token 'export'

To Reproduce
Steps to reproduce the behavior:

  1. Render Xterm component
  2. Run the dev server
  3. See error

Expected behavior
Render the Terminal UI.

Screenshots
If applicable, add screenshots to help explain your problem.
xterm

Desktop (please complete the following information):

  • OS: Windows 11
  • Browser Chrome
  • Version 100
@crwntec
Copy link

crwntec commented Jul 1, 2022

Actually the best thing to do is to ditch xterm-for-react. I had the same problem and its definetly easier to work with xterm.js, useEffect() and useRef to set it up: https://gist.github.com/neuron-electronics/0cabbfa5337a904d689e081e92926fa5#file-component-js

@Johnrobmiller
Copy link

this replicated for me also

1 similar comment
@Johnrobmiller
Copy link

this replicated for me also

@Johnrobmiller
Copy link

Johnrobmiller commented Oct 30, 2022

This is almost certainly a Next.js or SSR/SSG problem. I can see in the screenshot the Next.js debugger ui, and I was also using Next.js

Next.js rejects the library when dynamically importing it in.

The maintainer of this repo needs to fix this, because dynamic importing didn't work, I doubt there is a solution to this problem for Next.js users (I hope someone proves me wrong)

@twinsant
Copy link

Got it too.

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