Relay: Problem with configuration

Created on 24 Aug 2016  路  5Comments  路  Source: facebook/relay

Hi, I'm trying to configure Relay for around one week and without success. I'm already frustrated. As I solve one problem another one emerges. It looks like it will never end. I don't know what I'm doing wrong but right now I'm stuck with the following error:

Uncaught Invariant Violation: RelayQL: Unexpected invocation at runtime. Either the Babel transform was not set up, or it failed to identify this call site. Make sure it is being used verbatim as `Relay.QL`.

From what I know it's probable somehow related with babel-relay-plugin but everything seems to be configure properly. Here is very minimal repository https://github.com/usefulio/nextgen

Don't look at the server directory as it stopped working when I've change directories structure. The most important parts are webpack.config.js, packages.json, plugins/babelRelayPlugin.js and client directory. Can any one tell me what's wrong? Is there any good tutorial from start to end on how to work with webpack, babel and relay?

question

All 5 comments

Can check with the below course on Pluralsight its helpful

https://www.pluralsight.com/courses/react-apps-with-relay-graphql-flux

I was getting this error. I found a workaround. Instead of following the example .babelrc provided in relay-starter-kit which is

{
  "passPerPreset": true,
  "presets": [
    {
      "plugins": [
        "./build/babelRelayPlugin"
      ]
    },
    "react",
    "es2015",
    "stage-0"
  ]
}

I changed .babelrc to

{
"passPerPreset": true,
"plugins": [
"./build/babelRelayPlugin"
],
  "presets": [
    "react",
    "es2015",
    "stage-0"
  ]
}

This worked for me. I have not yet found the cause of the issue though.

(Spring cleaning.) I'm going through old issues cleaning out things that haven't had any activity in a while and it looks like this one has a workaround posted above, so I'm going to close it. For future reference, I'd recommend posting questions like this on a purpose-built Q&A forum like Stack Overflow, where you are more likely to get a timely response (and where others will be more likely to find the answer too and benefit from it). If you do post there in the future, please share a link to your Stack Overflow question here, to so that others stumbling across this can find it.

Sorry for not closing issue. In deed I've solved that problem, don't remember how.

Github pro tip: You can see your all issues you created here: https://github.com/issues

Was this page helpful?
0 / 5 - 0 ratings