Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require works, but import does not #51

Closed
gwh-cpnet opened this issue Sep 13, 2018 · 3 comments
Closed

require works, but import does not #51

gwh-cpnet opened this issue Sep 13, 2018 · 3 comments

Comments

@gwh-cpnet
Copy link

gwh-cpnet commented Sep 13, 2018

regarding node-amqp-connection-manager@2.1.1, with babel-cli@6.26, babel-preset-node8@1.2.0

const amqp = require('amqp-connection-manager');  
console.log(amqp);

run it with babel-node, it outputs:

{ connect: [Function: connect] }

but with import in ES6, amqp is undefined:

import amqp from 'amqp-connection-manager';
console.log(amqp);

outputs:

undefined

well, other deps in my code works fine. node-amqp-connection-manager@1.3.7 works fine too.

@jwalton
Copy link
Owner

jwalton commented Sep 13, 2018

A casualty of me rewriting this, converting from coffee-script to ES6. You can do this as a workaround:

import { connect } from 'amqp-connection-manager';

But I just committed a fix, so semantic-release should push a new build momentarily.

benbriadeploy pushed a commit that referenced this issue Sep 13, 2018
## [2.1.2](v2.1.1...v2.1.2) (2018-09-13)

### Bug Fixes

* Export a default object from root module. ([78893c9](78893c9)), closes [#51](#51)
@benbriadeploy
Copy link

🎉 This issue has been resolved in version 2.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gwh-cpnet
Copy link
Author

It is fixed. Thank you for the right-away response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants