Babel 5 plugin is being run with an unsupported Babel version

how to upgrade to babel 7
check babel version mac
babel/preset-env
babel-loader
babel/cli
@babel/plugin-transform-runtime npm
babel-polyfill
npm install babel 7

After I installed relay-query plugin with yarn add -D babel-plugin-react-relay, and after running the dev server, I get this error:

Error: [BABEL] /Users/nemanja/sites/tictacturing/src/index.js: The (relay-query) Babel 5 plugin is being run with an unsupported Babel version. (While processing: "/Users/nemanja/sites/tictacturing/node_modules/babel-plugin-react-relay/lib/index.js")
    at Array.reduce (<anonymous>)

This is my package.json file:

{
  "name": "tictacturing",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@babel/core": "7.1.0",
    "@svgr/webpack": "2.4.1",
    "babel-core": "7.0.0-bridge.0",
    "babel-eslint": "9.0.0",
    "babel-jest": "23.6.0",
    "babel-loader": "8.0.4",
    "babel-plugin-named-asset-import": "^0.2.3",
    "babel-preset-react-app": "^6.1.0",
    "bfj": "6.1.1",
    "case-sensitive-paths-webpack-plugin": "2.1.2",
    "chalk": "2.4.1",
    "css-loader": "1.0.0",
    "dotenv": "6.0.0",
    "dotenv-expand": "4.2.0",
    "eslint": "5.6.0",
    "eslint-config-react-app": "^3.0.5",
    "eslint-loader": "2.1.1",
    "eslint-plugin-flowtype": "2.50.1",
    "eslint-plugin-import": "2.14.0",
    "eslint-plugin-jsx-a11y": "6.1.2",
    "eslint-plugin-react": "7.11.1",
    "file-loader": "2.0.0",
    "fork-ts-checker-webpack-plugin-alt": "0.4.14",
    "fs-extra": "7.0.0",
    "html-webpack-plugin": "4.0.0-alpha.2",
    "identity-obj-proxy": "3.0.0",
    "jest": "23.6.0",
    "jest-pnp-resolver": "1.0.1",
    "jest-resolve": "23.6.0",
    "mini-css-extract-plugin": "0.4.3",
    "optimize-css-assets-webpack-plugin": "5.0.1",
    "pnp-webpack-plugin": "1.1.0",
    "postcss-flexbugs-fixes": "4.1.0",
    "postcss-loader": "3.0.0",
    "postcss-preset-env": "6.0.6",
    "postcss-safe-parser": "4.0.1",
    "react": "^16.6.3",
    "react-app-polyfill": "^0.1.3",
    "react-dev-utils": "^6.1.1",
    "react-dom": "^16.6.3",
    "react-relay": "^1.7.0",
    "resolve": "1.8.1",
    "sass-loader": "7.1.0",
    "style-loader": "0.23.0",
    "terser-webpack-plugin": "1.1.0",
    "url-loader": "1.1.1",
    "webpack": "4.19.1",
    "webpack-dev-server": "3.1.9",
    "webpack-manifest-plugin": "2.0.4",
    "workbox-webpack-plugin": "3.6.3"
  },
  "scripts": {
    "start": "GRAPHQL_ENDPOINT=https://api.graph.cool/relay/v1/cjoyiidl5gzv901148dsyafg1 node scripts/start.js",
    "build": "GRAPHQL_ENDPOINT=https://api.graph.cool/relay/v1/cjoyiidl5gzv901148dsyafg1 node scripts/build.js",
    "test": "node scripts/test.js"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ],
  "jest": {
    "collectCoverageFrom": [
      "src/**/*.{js,jsx,ts,tsx}",
      "!src/**/*.d.ts"
    ],
    "resolver": "jest-pnp-resolver",
    "setupFiles": [
      "react-app-polyfill/jsdom"
    ],
    "testMatch": [
      "<rootDir>/src/**/__tests__/**/*.{js,jsx,ts,tsx}",
      "<rootDir>/src/**/?(*.)(spec|test).{js,jsx,ts,tsx}"
    ],
    "testEnvironment": "jsdom",
    "testURL": "http://localhost",
    "transform": {
      "^.+\\.(js|jsx|ts|tsx)$": "<rootDir>/node_modules/babel-jest",
      "^.+\\.css$": "<rootDir>/config/jest/cssTransform.js",
      "^(?!.*\\.(js|jsx|ts|tsx|css|json)$)": "<rootDir>/config/jest/fileTransform.js"
    },
    "transformIgnorePatterns": [
      "[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$",
      "^.+\\.module\\.(css|sass|scss)$"
    ],
    "moduleNameMapper": {
      "^react-native$": "react-native-web",
      "^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy"
    },
    "moduleFileExtensions": [
      "web.js",
      "js",
      "web.ts",
      "ts",
      "web.tsx",
      "tsx",
      "json",
      "web.jsx",
      "jsx",
      "node"
    ]
  },
  "babel": {
    "plugins": [
      "react-relay"
    ],
    "presets": [
      "react-app"
    ]
  },
  "devDependencies": {
    "babel-plugin-react-relay": "^0.10.0",
    "babel-plugin-relay": "^1.7.0",
    "graphql": "^14.0.2"
  }
}

How to resolve this issue?

Since you are using react16 there is no need to eject to add the custom environment variable. Your custom environment variable must begin with REACT_APP_ in your script. This will solve the compatible issue.

    {
  "name": "tictacturing",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "react": "^16.6.3",
    "react-dom": "^16.6.3",
    "react-router": "^3.2.1",
    "react-scripts": "2.1.1"
  },
  "scripts": {
    "start": "REACT_APP_GRAPHQL_ENDPOINT=https://api.graph.cool/relay/v1/cjoyiidl5gzv901148dsyafg1 react-scripts start",
    "build": "REACT_APP_GRAPHQL_ENDPOINT=https://api.graph.cool/relay/v1/cjoyiidl5gzv901148dsyafg1 react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": "react-app"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ],
  "devDependencies": {
    "babel-plugin-react-relay": "^0.10.0"
  }
}

throw new Error("The (" + alias + ") Babel 5 plugin is being run with , getting this throw new Error("The (" + alias + ") Babel 5 plugin is being run with Babel 6."); Error: The (relay-query) Babel 5 plugin is being run  Stack Overflow for Teams is a private, secure spot for you and your coworkers to find and share information. (relay-query) Babel 5 plugin is being run with an

I think there is an upgrade for graphQL that is not applied in relay. so for running the react application, you can use the previous version:

"scripts": {
    "start": "GRAPHQL_ENDPOINT=https://api.graph.cool/relay/v1/cixqegi9u003g0196b2rtnhqu node scripts/start.js",
    "build": "GRAPHQL_ENDPOINT=https://api.graph.cool/relay/v1/cixqegi9u003g0196b2rtnhqu node scripts/build.js",
    "test": "node scripts/test.js --env=jsdom"

Upgrade to Babel 7 · Babel, I get this error: Error: [BABEL] /Users/nemanja/sites/tictacturing/src/index.js: The (relay-query) Babel 5 plugin is being run with an unsupported Babel version. Bug Report Current Behavior I've tried to move to Babel 7 on existing simple project. When I've finished migration I've got the error: throw Object.assign(err, { ^ Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3".

you shoud install babel by npm instead of yarn like below:

npm install -D babel-plugin-react-relay

babel-preset-env · Babel, Support for Node.js 0.10, 0.12, 4 and 5 has been dropped #5025, #5041, This just means Babel itself won't run on older versions of Node. You can still use the shorthand way of specifying a preset or plugin. In Babel 6, values passed to Babel directly (not from a config file), were resolved relative to the files being  After updating project dependencies I started seeing this error, there appears to be a versioning problem with the object-assign Babel 5 plugin. After the update I use Babel 6, the closest plugin I

Plugins · Babel, We can periodically run build-data.js which generates plugins.json. Ref: #7 A query to select browsers (ex: last 2 versions, > 5%) using browserslist. If you are using syntax unsupported by uglify-es , we recommend using babel-minify. # npx lets you run babel-upgrade without installing it locally npx babel-upgrade --write # or install globally and run npm install babel-upgrade -g babel-upgrade --write Without the --write (or -w ) flag, babel-upgrade will print a diff without writing any changes.

babel-plugin-react-relay, Babel is a compiler (source code => output code). Like many other compilers it runs in 3 stages: parsing, transforming, and printing. We recommend using babel-plugin-module-resolver@3's 'resolvePath' options babel/babel#6343. Removed babel.analyse because it was just an alias for babel.transform. Removed path.mark() since we didn't use it and it can be implemented in your own plugin. Removed babel.metadata since the generated plugin metadata is always included in the output

How to set up babel 7 and nodemon with Node Js, babel-plugin-react-relay. 0.10.0 • Public • Published 3 years ago. Readme · ExploreBETA · 3Dependencies · 2Dependents · 22Versions  { "plugins": [ "@org/babel-plugin-name", "@org/name" // equivalent] } Plugin Ordering. Ordering matters for each visitor in the plugin. This means if two transforms both visit the "Program" node, the transforms will run in either plugin or preset order. Plugins run before Presets. Plugin ordering is first to last.

Comments
  • Did you solve it? I got the same errors.
  • Hi @Telepresence, Nemus. Did you solve this issue. I get the same here: stackoverflow.com/questions/57671393/…