Skip to content

Plugin fails with ember-cli 2.13 and useBabelInstrumenter: true #111

Closed

Description

@paulcwatts

I assume this is known, but for tracking purposes:

$ ember -v
ember-cli: 2.13.0-beta.4
node: 6.10.1
os: darwin x64
$ ember new coverage-test
$ cd coverage-test
$ ember install ember-cli-code-coverage
$ COVERAGE=true ember test
...
1..8
# tests 8
# pass  8
# skip  0
# fail  0

# ok
$ echo "module.exports = { useBabelInstrumenter: true };" > config/coverage.js
$ COVERAGE=true ember test
 TypeError: The plugin [null,{}] didn't export a Plugin instance
    at PluginManager.validate (coverage-test/node_modules/babel-core/lib/transformation/file/plugin-manager.js:164:13)
    at PluginManager.add (coverage-test/node_modules/babel-core/lib/transformation/file/plugin-manager.js:213:10)
    at File.buildTransformers (coverage-test/node_modules/babel-core/lib/transformation/file/index.js:237:21)
    at new File (coverage-test/node_modules/babel-core/lib/transformation/file/index.js:139:10)
    at Pipeline.transform (coverage-test/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at Instrumenter.instrumentSync (coverage-test/node_modules/ember-cli-code-coverage/lib/babel-istanbul-instrumenter.js:36:45)
    at CoverageInstrumenter.processString (coverage-test/node_modules/ember-cli-code-coverage/lib/coverage-instrumenter.js:113:25)
    at CoverageInstrumenter.processFile (coverage-test/node_modules/broccoli-filter/index.js:165:31)
    at asyncProcessFile (coverage-test/node_modules/broccoli-filter/index.js:122:21)
    at tryCatch (coverage-test/node_modules/rsvp/dist/rsvp.js:539:12)
Unable to cover: app/resolver.js . Try setting useBabelInstrumenter to true. 
 TypeError: The plugin [null,{}] didn't export a Plugin instance
    at PluginManager.validate (coverage-test/node_modules/babel-core/lib/transformation/file/plugin-manager.js:164:13)
    at PluginManager.add (coverage-test/node_modules/babel-core/lib/transformation/file/plugin-manager.js:213:10)
    at File.buildTransformers (coverage-test/node_modules/babel-core/lib/transformation/file/index.js:237:21)
    at new File (coverage-test/node_modules/babel-core/lib/transformation/file/index.js:139:10)
    at Pipeline.transform (coverage-test/node_modules/babel-core/lib/transformation/pipeline.js:164:16)
    at Instrumenter.instrumentSync (coverage-test/node_modules/ember-cli-code-coverage/lib/babel-istanbul-instrumenter.js:36:45)
    at CoverageInstrumenter.processString (coverage-test/node_modules/ember-cli-code-coverage/lib/coverage-instrumenter.js:113:25)
    at CoverageInstrumenter.processFile (coverage-test/node_modules/broccoli-filter/index.js:165:31)
    at asyncProcessFile (coverage-test/node_modules/broccoli-filter/index.js:122:21)
    at tryCatch (coverage-test/node_modules/rsvp/dist/rsvp.js:539:12)
...

I'm pretty green with Babel and Babel plugins, but if pointed in the right direction I can take a look at making this work!

Activity

  1. ming-codes commented on May 1, 2017

    @ming-codes
    Contributor

    Ember CLI 2.13 moved to babel 6. Babel plugins works differently in babel 6 and I see ember-cli-code-coverage does uses a babel plugin for transformation. Perhaps this is the reason?

  2. rwjblue commented on May 2, 2017

    @rwjblue
    Collaborator

    Thanks for reporting! The issue lies with the fact that we provide babel options from the host app into our custom babel instrumenter (which is based on babel-core@5). Using babel-core@5 as the instrumenter itself is totally fine (though we should also update to babel@6), but passing babel@6 plugins to babel@5 is causing the reported error.

  3. changed the title [-]Plugin fails with ember-cli 2.13.0-beta.4 and useBabelInstrumenter: true[/-] [+]Plugin fails with ember-cli 2.13 and useBabelInstrumenter: true[/+] on May 12, 2017
  4. paulcwatts commented on May 12, 2017

    @paulcwatts
    ContributorAuthor

    I've been working on fixing this here: #115. This updates babel-core to 6.x, which seems to make it work using the new ember-cli. However, I don't know how this will affect older versions not upgraded to the latest ember-cli/babel@6.

    I still have to have to some real-world testing.

  5. Turbo87 commented on May 18, 2017

    @Turbo87
    Collaborator
  6. rwjblue commented on May 18, 2017

    @rwjblue
    Collaborator

    Ya, possibly. I'd have to check, but it seems reasonable.

  7. paulcwatts commented on May 18, 2017

    @paulcwatts
    ContributorAuthor

    That definitely looks promising. I will look to see how I can integrate that.

  8. added a commit that references this issue on Jun 21, 2017
    09b20ee
  9. added a commit that references this issue on Oct 15, 2018
    2c1fd17
  10. added a commit that references this issue on Oct 27, 2019
    8369091
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