TypeError: babelAddon.buildBabelOptions is not a function

I am having an ember application with following ember dependencies and version

"ember-cli": "2.18.0",
"ember-cli-app-version": "^2.0.1",
"ember-cli-babel": "^5.1.7",
...

I run yarn to fetch all dependencies and it worked perfectly fine but when I run the ember application I am getting

babelAddon.buildBabelOptions is not a function

Below is the complete log.

- broccoliBuilderErrorStack: [undefined]
  - code: [undefined]
  - codeFrame: [undefined]
  - errorMessage: babelAddon.buildBabelOptions is not a function
  - errorType: [undefined]
  - location:
    - column: [undefined]
    - file: [undefined]
    - line: [undefined]
  - message: babelAddon.buildBabelOptions is not a function
  - name: TypeError
  - nodeAnnotation: [undefined]
  - nodeName: [undefined]
  - originalErrorMessage: [undefined]
  - stack: TypeError: babelAddon.buildBabelOptions is not a function
    at Package.buildBabelOptions (/Users/sahilpaudel/Documents/PharmEasy/Elixir/AfterGlow/frontend/node_modules/ember-auto-import/js/package.js:47:39)
    at new Package (/Users/sahilpaudel/Documents/PharmEasy/Elixir/AfterGlow/frontend/node_modules/ember-auto-import/js/package.js:30:46)
    at Function.lookup (/Users/sahilpaudel/Documents/PharmEasy/Elixir/AfterGlow/frontend/node_modules/ember-auto-import/js/package.js:38:35)
    at new AutoImport (/Users/sahilpaudel/Documents/PharmEasy/Elixir/AfterGlow/frontend/node_modules/ember-auto-import/js/auto-import.js:26:45)
    at Function.lookup (/Users/sahilpaudel/Documents/PharmEasy/Elixir/AfterGlow/frontend/node_modules/ember-auto-import/js/auto-import.js:39:27)
    at Class.included (/Users/sahilpaudel/Documents/PharmEasy/Elixir/AfterGlow/frontend/node_modules/ember-auto-import/js/index.js:26:48)
    at Class.superWrapper [as included] (/Users/sahilpaudel/Documents/PharmEasy/Elixir/AfterGlow/frontend/node_modules/ember-cli/node_modules/core-object/lib/assign-properties.js:34:20)
    at /Users/sahilpaudel/Documents/PharmEasy/Elixir/AfterGlow/frontend/node_modules/ember-cli/lib/models/addon.js:405:26
    at Array.reduce (<anonymous>)
    at Class.eachAddonInvoke (/Users/sahilpaudel/Documents/PharmEasy/Elixir/AfterGlow/frontend/node_modules/ember-cli/lib/models/addon.js:402:24)

Any help please.

I think the problem is that ember-auto-import doesn’t work with the very old version of ember-cli-babel you’re using.

Anyway to resolve this issue ?

Does your app directly depend on ember-auto-import? Or is it being pulled in by some other addon?

I would try upgrading just ember-cli-babel first. This will give you a new major release of Babel, which means if you have added any Babel plugins you’ll need to update them as well. But it’s worth doing, you don’t want to be stuck on Babel 5 forever.

It is resolved now without doing anything I am not sure what was the issue might be using older babel version.

Thanks for help though.