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

Unable to module.exports = esModule without cloning #104

Closed
arackaf opened this issue Sep 22, 2017 · 2 comments
Closed

Unable to module.exports = esModule without cloning #104

arackaf opened this issue Sep 22, 2017 · 2 comments
Labels

Comments

@arackaf
Copy link

arackaf commented Sep 22, 2017

https://github.com/arackaf/mongo-graphql-starter/blob/special/jdd/index.js#L3

Named exports, in particular createGraphqlSchema from

https://github.com/arackaf/mongo-graphql-starter/blob/special/jdd/src/module.js

are not available unless I clone the object, like in the original link above.

To repro, clone that repo, npm i then jump into the test folder and run node testRoot. With the Object.assign from the top-level index.js (or object spread, obviously), it works, and logs "function". If you remove the clone, and just export the ES module itself

module.exports = require("./src/module.js");

it blows up.

@jdalton jdalton added the bug label Sep 22, 2017
@jdalton
Copy link
Member

jdalton commented Sep 22, 2017

Thanks @arackaf!

This is an interesting case of cjs bridge use. I'll add a unit and cut a release soon.

@jdalton
Copy link
Member

jdalton commented Sep 23, 2017

v0.11.0 is released 🎉

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

No branches or pull requests

2 participants