Skip to content

useBabelInstrumenter:true does not work in ember 2.11 #131

Closed

Description

@les2

I'm attempting to use async-await in ember 2.11 with code coverage enabled.

  • the app will work fine
  • tests work fine without coverage (ember test will succeed)

But ember-cli-code-coverage goes berserk:

// config/coverage.js
  useBabelInstrumenter: true,
  babelPlugins: [
    'babel-plugin-transform-async-to-generator',
  ],

Running tests with coverage (COVERAGE=true ember test) results hundreds of errors like:

Unable to cover: app/transforms/foo.js . Newer JS features may need Babel instumentation to work. Try setting useBabelInstrumenter to true in your config/coverage.js.
 ReferenceError: [BABEL] app/transforms/ai-socialcode-audience-type.js: Using removed Babel 5 option: base.modules - Use the corresponding module transform plugin in the `plugins` option. Check out http://babeljs.io/docs/plugins/#modules

for every file.

 ember --version
ember-cli: 2.11.1
node: 6.11.1
os: darwin x64
    "ember-cli-code-coverage": "^0.4.1",

Activity

  1. kategengler commented on Jul 30, 2017

    @kategengler
    Collaborator

    Is the info in this issue (#123) helpful?

  2. RobbieTheWagner commented on Sep 30, 2017

    @RobbieTheWagner
    Collaborator

    Hi @les2 fancy seeing you here 😄 . Have you taken a look at #123 as @kategengler suggested? I am curious if any of the things done there help this situation.

  3. Leooo commented on Oct 29, 2017

    @Leooo

    I'm having the same problem with the following option in ember-cli-build:

      options.babel = {
        includePolyfill: true
      };
    

    or

      options['ember-cli-babel'] = {
        includePolyfill: true
      };
    

    ember-cli@2.10.0
    ember@2.9.1 (need to update)
    useBabelInstrumenter is also true
    Can't move this option in a plugin as #123 suggested.

  4. RobbieTheWagner commented on Oct 30, 2017

    @RobbieTheWagner
    Collaborator

    @Leooo what version of ember-cli-babel are you on in your project?

  5. Leooo commented on Oct 30, 2017

    @Leooo

    @rwwagner90 6.8.2

  6. alvincrespo commented on Nov 3, 2017

    @alvincrespo

    I'm also running into this issue as well. The process also doesn't quit, it gets stuck.

    config/coverage.js

    /* eslint-env node */
    
    module.exports = {
      useBabelInstrumenter: true
    };
    

    package.json

      "devDependencies": {
        ...
        "ember-cli-babel": "^6.8.2",
        "ember-cli-code-coverage": "^0.4.2",
        ...
      }
    

    ember-cli-build.js

        'ember-cli-babel': {
          includePolyfill: true
        },
    
  7. alvincrespo commented on Nov 3, 2017

    @alvincrespo
  8. alvincrespo commented on Nov 3, 2017

    @alvincrespo

    I'd like to note, that if there is no config/coverage.js we get:

    But if we include the config/coverage.js with useBabelInstrumenter set to true, we get:

  9. alvincrespo commented on Nov 3, 2017

    @alvincrespo

    As noted previously, this appears fixed on master?

    I changed package.json from:

    "ember-cli-code-coverage": "^0.4.2",

    to:

    "ember-cli-code-coverage": "git://github.com/kategengler/ember-cli-code-coverage",

  10. RobbieTheWagner commented on Nov 3, 2017

    @RobbieTheWagner
    Collaborator

    @alvincrespo looks like you are pulling in ember-cli-babel instead of ember-cli-code-coverage there.

  11. alvincrespo commented on Nov 3, 2017

    @alvincrespo

    oops - copied the wrong line. Updated my comment above.

  12. RobbieTheWagner commented on Nov 3, 2017

    @RobbieTheWagner
    Collaborator

    @alvincrespo that's odd that it works on master. There have been no commits to master since 0.4.2 was released.

  13. alvincrespo commented on Nov 3, 2017

    @alvincrespo

    Yeah, it's super weird. I've been in the weeds for about 3 hours now. Going to rest my 👀 and 🧠

  14. Syzygy24 commented on Jan 31, 2018

    @Syzygy24

    Any updates on this?

  15. kategengler commented on Jan 31, 2018

    @kategengler
    Collaborator

    #141 and #145 have since been landed, which obsoleted the useBabelInstrumenter option

  16. RobbieTheWagner commented on Jan 31, 2018

    @RobbieTheWagner
    Collaborator

    Agreed. This should be resolved. I know we are running test coverage fine again in the apps @les2 was mentioning, so we should be good here. If anyone is still experiencing issues, please let us know!

  17. les2 commented on Apr 5, 2018

    @les2
    Author

    yep, everything's working now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions