power-assert-js / babel-plugin-espower

Babel plugin for power-assert
MIT License
93 stars 6 forks source link

TypeError: babel.Transformer is not a function #10

Closed radiovisual closed 8 years ago

radiovisual commented 8 years ago

When I run this command to transpile via babel:

babel lib --out-dir=dist

I get the following error:

TypeError: babel.Transformer is not a function
    at createEspowerPlugin (/Users/michael/gitprojects/mytestapp/node_modules/babel-plugin-espower/create.js:6:12)
    at module.exports (/Users/michael/gitprojects/mytestapp/node_modules/babel-plugin-espower/index.js:16:12)
    at Function.memoisePluginContainer (/Users/michael/gitprojects/mytestapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:127:13)
    at Function.normalisePlugin (/Users/michael/gitprojects/mytestapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:161:32)
    at /Users/michael/gitprojects/mytestapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:197:30
    at Array.map (native)
    at Function.normalisePlugins (/Users/michael/gitprojects/mytestapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:173:20)
    at OptionManager.mergeOptions (/Users/michael/gitprojects/mytestapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:271:36)
    at OptionManager.addConfig (/Users/michael/gitprojects/mytestapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:221:10)
    at OptionManager.findConfigs (/Users/michael/gitprojects/mytestapp/node_modules/babel-core/lib/transformation/file/options/option-manager.js:364:16)

I am using the following babel packages/plugins:

    "babel-cli": "^6.2.0",
    "babel-preset-es2015": "^6.1.18",
    "babel-preset-stage-3": "^6.1.18",

I read your warning that Babel 5 needs to use the older release of the plugin: babel-plugin-espower@1.1.0, but I am using Babel 6.x in my app, but my attempt to transpile always ends in this error.

Any ideas?

twada commented 8 years ago

@radiovisual Thank you for reporting. To run with Babel 6, you need to install babel-plugin-espower 2.0.0 or above.

The message babel.Transformer is not a function indicates that babel-plugin-espower 1.1.0 is running.

Please make sure to install babel-plugin-espower 2.0.0. For example, by deleting node_modules and running npm install --save-dev babel-plugin-espower again.

radiovisual commented 8 years ago

@twada , Thanks for the quick response, I really appreciate it!

Your suggestion worked. As soon as I re-installed the latest version and removed all traces of the old version from my node_modules directory the problem went away.

Thanks again! :smile:

twada commented 8 years ago

@radiovisual Glad to hear that! :smiley: