1

Since upgrading React and Babel, I'm getting this error in one of my files. It is clearly a phantom error as everything worked fine before and this file wasn't changed at all. Does anyone have a clue what is happening here and how I can fix it?

The error

Uncaught Error: Relay transform error Syntax Error FileXYZ - Unexpected character "\u2028".

9: user_id

10: user_name ^

in file XYZ. Try updating your GraphQL schema if an argument/field/type was recently added.

My previous package.json was like this:

"dependencies": {
    "babel-core": "^5.8.22",
    "babel-loader": "^5.3.2",
    "babel-polyfill": "^6.5.0",
    "babel-preset-es2015": "^6.0.0",
    "babel-preset-react": "^6.0.0",
    "babel-relay-plugin": "^0.3.0",
    "es5-shim": "^4.5.7",
    "graphiql": "0.6.6",
    "graphql": "^0.4.18",
    "history": "1.13.1",
    "isomorphic-fetch": "^2.1.1",
    "react": "^0.14.8",
    "react-addons-shallow-compare": "^0.14.0",
    "react-chartjs": "^0.6.0",
    "react-dom": "^0.14.0",
    "react-loader": "^2.0.0",
    "react-relay": "^0.4.0",
    "react-router": "1.0.0-rc3",
    "react-router-relay": "^0.7.0",
    "superagent": "^1.2.0",
    "webpack": "^1.13.1"
  },
  "devDependencies": {
    "babel-eslint": "^3.1.30",
    "babel-jest": "^5.3.0",
    "jest-cli": "^0.9.0",
    "react-addons-test-utils": "^0.14.0-beta3"
  },

Now it is like this:

"dependencies": {
    "babel-polyfill": "^6.9.1",
    "babel-runtime": "^6.9.2",
    "es5-shim": "^4.5.7",
    "graphiql": "0.7.3",
    "graphql": "^0.6.2",
    "history": "1.13.1",
    "isomorphic-fetch": "^2.1.1",
    "react": "^15.2.1",
    "react-addons-shallow-compare": "^15.2.1",
    "react-dom": "^15.2.1",
    "react-loader": "^2.0.0",
    "react-relay": "^0.9.2",
    "react-router": "1.0.0-rc3",
    "react-router-relay": "^0.7.0",
    "superagent": "^1.2.0"
  },
  "devDependencies": {
    "babel-core": "^6.11.4",
    "babel-eslint": "^6.1.2",
    "babel-jest": "^13.2.2",
    "babel-loader": "^6.2.4",
    "babel-plugin-add-module-exports": "^0.2.1",
    "babel-plugin-transform-runtime": "^6.9.0",
    "babel-preset-es2015": "^6.9.0",
    "babel-preset-react": "^6.11.1",
    "babel-preset-stage-0": "^6.5.0",
    "babel-preset-stage-1": "^6.5.0",
    "babel-preset-stage-2": "^6.11.0",
    "babel-relay-plugin": "^0.9.2",
    "jest-cli": "^12.1.1",
    "react-addons-test-utils": "^15.2.1",
    "webpack": "^1.13.1"
  },

I haven't been able to update react-router and relay as of yet as it introduced many breaking changes, which I haven't been able to address completely and I'm asking about this in a different question.

Any help on the this issue would be greatly appreciated. Thanks!

Chris
  • 57,622
  • 19
  • 111
  • 137
alengel
  • 4,368
  • 3
  • 21
  • 28
  • I've been able to address the react-router and relay changes but this doesn't fix the issue - so I'm still at a loss for why this is suddenly breaking. – alengel Aug 04 '16 at 21:24
  • 1
    Based on the error message it looks like the query fragment has some stray line separator character. Presumably it was ignored before, but the query parser has become stricter after the update. Can you try removing the line in the fragment that the error points to and typing it again without copying, so the hidden characters get removed? – fson Aug 07 '16 at 11:01
  • Yes, that was it! I just removed everything my colleague had previously added on a Windows machine I believe and retyped it and now it's fine. Thanks! – alengel Aug 09 '16 at 17:21

0 Answers0