Rick
Rick5mo ago

Loading hybrid packages from npm (graphql-tag)

i am currently trying to get dagger.io to run using deno and i am currently hitting this import issue:
error: Uncaught SyntaxError: The requested module 'graphql-tag' does not provide an export named 'gql'
at <anonymous> (file:///Users/igl/Library/Caches/deno/npm/registry.npmjs.org/@dagger.io/dagger/0.12.6/dist/index.js:3:10)
error: Uncaught SyntaxError: The requested module 'graphql-tag' does not provide an export named 'gql'
at <anonymous> (file:///Users/igl/Library/Caches/deno/npm/registry.npmjs.org/@dagger.io/dagger/0.12.6/dist/index.js:3:10)
graphql-tag seems to be a "hybrid" package with these fields:
"main": "./main.js",
"module": "./lib/index.js",
"jsnext:main": "./lib/index.js",
"main": "./main.js",
"module": "./lib/index.js",
"jsnext:main": "./lib/index.js",
if i slightly modify their package.json in my deno cache and set "main" to "./lib/index.js" it works fine. I am not so familiar with how deno recognizes a hybrid package. What would the best approach here be? Can this be fixed with a small patch to graphql-tag?
1 Reply
marvinh.
marvinh.5mo ago
It's a bug in Deno. We should've picked the module entry point. Filed an issue for that https://github.com/denoland/deno/issues/25311

Did you find this page helpful?