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

Error - "Failed to compile" #7

Open
faire2 opened this issue Jun 22, 2020 · 3 comments
Open

Error - "Failed to compile" #7

faire2 opened this issue Jun 22, 2020 · 3 comments

Comments

@faire2
Copy link

faire2 commented Jun 22, 2020

I have installed the library and tried to create a simple component and then copy the example 1:1, but in both cases I endad up with this error:

./node_modules/shaka-player-react/src/index.js
SyntaxError: D:\dev\Projects\movie-api\node_modules\shaka-player-react\src\index.js: Unexpected token (70:4)

  68 | 
  69 |   return (
> 70 |     <div ref={uiContainerRef}>
     |     ^
  71 |       <video
  72 |         ref={videoRef}
  73 |         autoPlay={autoPlay}

When I deleted the test component I noticed that the error persists, so it seems that something iswrong with the installation.

I have not yet imported css (I am still trying to understand how should I do that) but the problem seems unrelated to that.

I am using it in a small-scale react project:

...
"dependencies": {
    "@testing-library/jest-dom": "^4.2.4",
    "@testing-library/react": "^9.5.0",
    "@testing-library/user-event": "^7.2.1",
    "axios": "^0.19.2",
    "react": "^16.13.1",
    "react-dom": "^16.13.1",
    "react-scripts": "3.4.1",
    "react-spinners": "^0.8.3",
    "shaka-player-react": "^1.0.1"
  },
...

I have no experience with refs other than reading React docs on them so I am really clueless at this point.

@matvp91
Copy link
Owner

matvp91 commented Jun 23, 2020

This looks like a misconfiguration, are you using babel to transpile?

The Unexpected token is triggered because your bundler / transpiler does not recognize JSX (thus does not transpile it to React.createElement.

Could you share your bundler (webpack, rollup, ...) and transpiler (babel) config?

@faire2
Copy link
Author

faire2 commented Jun 23, 2020

I am using create-react-app - would it help if I posted the contents of package.json / package-lock.json?

But it is a fresh installation, I have only added axis and react-spinners. I will try to create a fresh procet to see if the problem reproduces.

@matvp91
Copy link
Owner

matvp91 commented Dec 13, 2020

@faire2 Did your problem still occur with a fresh project?

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

2 participants