中继转换错误 - 意外字符“\ u2028”

时间:2016-07-28 16:59:52

标签: reactjs npm relayjs relay react-router-relay

自升级React和Babel以来,我在其中一个文件中收到此错误。这显然是一个幻象错误,因为之前一切正常,这个文件根本没有改变。有没有人知道这里发生了什么以及如何解决它?

错误

  

未捕获错误:中继转换错误Syntax Error FileXYZ - Unexpected character "\u2028".

     

9:user_id

     

10:user_name                                    ^

     

在文件XYZ中。如果最近添加了参数/字段/类型,请尝试更新GraphQL架构。

我以前的 package.json 是这样的:

"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"
  },

现在是这样的:

"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"
  },

我还没有能够更新react-router和relay,因为它引入了许多重大变化,我无法完全解决这个问题,而且我在另一个{{3}中提出这个问题。 }。

对此问题的任何帮助将不胜感激。谢谢!

0 个答案:

没有答案