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

Support deno #41

Open
metrue opened this issue Mar 5, 2024 · 1 comment
Open

Support deno #41

metrue opened this issue Mar 5, 2024 · 1 comment
Labels
good first issue Good for newcomers

Comments

@metrue
Copy link
Owner

metrue commented Mar 5, 2024

I am trying following test,

import { EdgeQL, Context } from 'npm:edgeql';

const app = new EdgeQL()

app.handle(`
type Query {
  hello: String
}
`, (ctx: Context) => {
    return 'hello from EdgeQL on Deno'
})

Deno.serve((req: Request) => {
  return app.fetch(req)
})

but getting following errors

error: 'import', and 'export' cannot be used outside of module code at file:///Users/minhuang/Codes/EdgeQL/examples/deno/node_modules/.deno/edgeql@0.1.3/node_modules/edgeql/dist/esm/index.js:1:1

  export { EdgeQL } from './app';
  ~~~~~~
```

@metrue metrue added the good first issue Good for newcomers label Mar 7, 2024
@metrue metrue changed the title Support more runtimes (node, deno, bun, etc) Support deno Mar 7, 2024
@metrue
Copy link
Owner Author

metrue commented Mar 8, 2024

After add type to package.json of Edge, now the error is different, but still related to module resolution.

error: Could not resolve './app' from 'file:///.../node_modules/.deno/edgeql@0.1.4/node_modules/edgeql/dist/esm/index.js'.

Caused by:
    [ERR_MODULE_NOT_FOUND] Cannot find module "file:///..../node_modules/.deno/edgeql@0.1.4/node_modules/edgeql/dist/esm/app" imported from "file:///..../node_modules/.deno/edgeql@0.1.4/node_modules/edgeql/dist/esm/index.js"

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

No branches or pull requests

1 participant