graphql-voyager icon indicating copy to clipboard operation
graphql-voyager copied to clipboard

Uncaught SyntaxError: Unexpected token <

Open barbalex opened this issue 5 years ago • 8 comments

This error occurs only in production - in dev it works fine: 2018-09-27_11h55_07

Some info:

  • Windows 10 (dev)
  • Ubuntu 16.04.5 (prod)
  • Chrome 69.0.3497.100
  • graphql-voyager 1.0.0-rc.25
  • create-react-app v2
  • my project: https://github.com/FNSKtZH/ae2
  • worker file: https://github.com/FNSKtZH/ae2/blob/master/public/voyager.worker.js
  • the component itself: https://github.com/FNSKtZH/ae2/blob/master/src/components/DataGraph/index.js

Seems similar to https://github.com/APIs-guru/graphql-voyager/issues/44. Maybe the issue is create-react-app in v2?

barbalex avatar Sep 27 '18 10:09 barbalex

I'm getting this error in both dev and prod.

JHibbard avatar Jan 01 '19 00:01 JHibbard

@barbalex Did you resolve this? I'm facing the same issue with rc.26

stevenmckinnon avatar Apr 22 '19 15:04 stevenmckinnon

@stevenmckinnon no, I gave up

barbalex avatar Apr 23 '19 07:04 barbalex

@barbalex I managed to get past it this morning by adding this to my webpack: new CopyWebpackPlugin([ { from: './node_modules/graphql-voyager/dist/voyager.worker.js' } ])

stevenmckinnon avatar Apr 23 '19 08:04 stevenmckinnon

@stevenmckinnon @barbalex @JHibbard Sorry for the silence. Currently, voyager.worker.js is the most problematic part of integrating voyager into 3rd-party apps/sites. So we working on bundling everything into a single ~600kb JS file. ATM, it's our biggest priority for this project and the only blocker for 1.0.0 release. We will try to finish this project in the next few weeks.

IvanGoncharov avatar Apr 23 '19 11:04 IvanGoncharov

Hi @IvanGoncharov I have the same issue using when trying to integrate this component in our application using the version 1.0.0-rc.28. Appears the error Uncaught SyntaxError: Unexpected token '<' and stuck with Transmitting. Is need to wait for version 1.0.0 for this to be solved ? Many thanks

andrectw avatar Dec 11 '19 18:12 andrectw

Hi! I am using ^1.0.0-rc.31 version but I have the same issue. Do you have any updates on this? Thanks!

DCosti avatar Jul 08 '21 14:07 DCosti

Same issue here with 1.0.0-rc.31. Is this project still maintained? Looks like this issue has been open for about 2 years now.

sandromartis avatar Nov 03 '21 10:11 sandromartis

I'm using graphql-voyager 1.0.0-rc.31 , I tried create-react-app v4 and then webpack 4, but I still get Uncaught Syntax error, seems like voyager.worker.js is not rendering. Any updates on this?

prakhathi-m avatar Feb 11 '23 22:02 prakhathi-m

I released v1.0.0, which has workers bundled in. If you still experience a similar issue after v1.0.0, please feel free to open a new issue.

IvanGoncharov avatar Mar 18 '23 10:03 IvanGoncharov