Uncaught SyntaxError: Unexpected token '<' #4

Closed
opened 2020-03-10 15:52:57 +00:00 by sharpapp-mareklanduch · 2 comments
sharpapp-mareklanduch commented 2020-03-10 15:52:57 +00:00 (Migrated from github.com)

Hi

First of all I rised an issue in your ssf repository which I'll close in a second, it turned out that actually frac is causing this error.

I ran "yarn add frac". I haven't done any imports of this library in my existing project just ran "yarn add frac". After that I ran"yarn install" to install all dependencies and then "yarn start".
No compilation error just "Uncaught SyntaxError: Unexpected token '<'" in chrome console
image

Tried on react-scripts versions 3.4.0 - not working,
3.3.1 - not working,
3.2.0 WORKING :)

So if react-scripts in version 3.2.0 works just fine is it something that you guys could fix or is it something wrong with react-scripts

Because of this error library xlsx is not working since ssf is one of it's dependencies and frac is the only dependency of ssf :)

node v. 12.13.1
yarn v. 1.21.1
Windows 10 v.1809 - I have suspicion that on linux everything is fine

Hi First of all I rised an issue in your ssf repository which I'll close in a second, it turned out that actually frac is causing this error. I ran "yarn add frac". I haven't done any imports of this library in my existing project just ran "yarn add frac". After that I ran"yarn install" to install all dependencies and then "yarn start". No compilation error just "Uncaught SyntaxError: Unexpected token '<'" in chrome console image Tried on react-scripts versions 3.4.0 - not working, 3.3.1 - not working, 3.2.0 WORKING :) So if react-scripts in version 3.2.0 works just fine is it something that you guys could fix or is it something wrong with react-scripts Because of this error library xlsx is not working since ssf is one of it's dependencies and frac is the only dependency of ssf :) node v. 12.13.1 yarn v. 1.21.1 **Windows 10 v.1809** - I have suspicion that on linux everything is fine
SheetJSDev commented 2020-03-10 15:57:36 +00:00 (Migrated from github.com)

This sounds like an issue with react-scripts, and https://github.com/facebook/create-react-app/issues/8398 has a suggestion. Can you try following the steps (eject your app, change the webpack config) and see if it works? If it does, I recommend raising a new issue with CRA;.

This sounds like an issue with react-scripts, and https://github.com/facebook/create-react-app/issues/8398 has a suggestion. Can you try following the steps (eject your app, change the webpack config) and see if it works? If it does, I recommend raising a new issue with CRA;.
sharpapp-mareklanduch commented 2020-03-11 15:35:45 +00:00 (Migrated from github.com)

https://github.com/facebook/create-react-app/issues/8490 - this thread helped me to solve my issue

I had unexpected token because I used PUBLIC_PATH variable in .env file
PUBLIC_PATH:/my-app/
I didn't have this variable in .env.development file.
So in react-scripts 3.2.0 it was by default "/" and after I updated react scripts it was failing with unexpected token error. I simply added PUBLIC_PATH:/ to my .env.development file.

https://github.com/facebook/create-react-app/issues/8490 - this thread helped me to solve my issue I had unexpected token because I used PUBLIC_PATH variable in .env file PUBLIC_PATH:/my-app/ I didn't have this variable in .env.development file. So in react-scripts 3.2.0 it was by default "/" and after I updated react scripts it was failing with unexpected token error. I simply added PUBLIC_PATH:/ to my .env.development file.
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/frac#4
No description provided.