crystal
crystal copied to clipboard
Typo in postgraphile/examples/servers/koa/vanilla.ts
https://github.com/graphile/postgraphile/blob/7d2906c1c23d29f7ad4932779aaccb8604e065e3/examples/servers/koa/vanilla.ts#L2
Please could you detail what the typo is? I don't see it.
My bad: I didn't know this syntax existed.
I just found the reference: https://www.typescriptlang.org/docs/handbook/modules.html#export--and-import--require (in case anyone else is confused).
Sorry for the false alert!
BTW, I get the following error in VSCode for this line:
Import assignment cannot be used when targeting ECMAScript modules. Consider using 'import * as ns from "mod"', 'import {a} from "mod"', 'import d from "mod"', or another module format instead.ts(1202)
I reopen this issue in case someone has a suggestion about the Typescript error.
It's a painful time right now for ESM versus CommonJS. The example assumes you're compiling down to CommonJS, with ESM you can't use require (why?!) so either replace it with a proper import statement or await import('...') somewhere.