-
Notifications
You must be signed in to change notification settings - Fork 147
error [ERR_REQUIRE_ESM] with esm/cjs hybrid module and non-hybrid cjs dependency #286
Comments
I'll try to come up with a test case in the meanwhile without a 3rd-party-dependency. |
Hi @dnalborczyk! Could you create a simple repro repo for me to look at? |
@jdalton sure thing, here you go: https://github.com/dnalborczyk/stdesm-graphql I added a couple of npm convinience scripts: "start-stdesm-cjs": "node -r edit: npm install graphql@0.13.0 and change ... import { execute, subscribe } from 'graphql' to import graphql from 'graphql'
const { execute, subscribe } = graphql in index.js and index.mjs. thanks for looking into this!! |
@dnalborczyk Ok thanks! I found the issue. It comes down to a simple check d851897. Update: Hey @dnalborczyk! I have to pay the unit test debt for this tomorrow. You wouldn't be up for creating a PR with a scenario test for this would you? |
cool, thanks!!! yeah, I'll try to add a scenario test. |
added scenario test #288 it's the best I could come up with. I must admit I got confused along the way ... 😃 |
v0.23.0 is released 🎉 |
just confirmed, works beautifully! thank you for the fix! |
graphql recently published a new version 0.13.1 with ESM .mjs support in addition to CJS graphql/graphql-js#1244
every CJS module having a dependency on graphql is throwing an error now when loaded with std/esm.
node.js: 9.5.0
std/esm: 0.22.0 (also tried a variety of previous versions to see if it is a regression)
repro:
index.js
esmrc
console
error:
The text was updated successfully, but these errors were encountered: