dotansimha / dotansimha/graphql-code-generator
TypeScript error when setting the `module` option to `esnext`
- Dominant language
- TypeScript
- Stars
- 11.3k
- Forks
- 1.4k
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 23
Description
**Describe the bug**
It appears that if you set the `compilerOptions.module` setting in a `tsconfig.json` to `esnext`, this causes `graphql-gen` to fail with the following error:
```
Unable to load from file "path/to/module.ts": Cannot use import statement outside a module
```
This would be useful for me, as I am working the TypeScript in a Next.js project and the framework automatically sets this option to `esnext` for me.
**To Reproduce**
Steps to reproduce the behavior:
[Here's a reproduction instead](https://codesandbox.io/s/hopeful-tdd-hlbfc?file=/tsconfig.json)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.