Skip to content

Vanilla JS Hello World example throwing error #1145

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

Closed
deadcoder0904 opened this issue Jun 30, 2020 · 4 comments
Closed

Vanilla JS Hello World example throwing error #1145

deadcoder0904 opened this issue Jun 30, 2020 · 4 comments

Comments

@deadcoder0904
Copy link

Basically I have an old project where I haven't used TS because it's not needed.

I'd love a simple Hello World Vanilla JS example as everything in https://github.com/graphql-nexus/examples is TS specific.

And I am getting an error when using the new Nexus in my old Vanilla JS project:

1203 ✕ nexus Your tsconfig.json is invalid

error TS18003: No inputs were found in config file '~/nexus-tutorial/tsconfig.json'.
Specified 'include' paths were '["types.d.ts","."]' and 'exclude' paths were '[]'.

My tsconfig.json file looks like:

{
  "compilerOptions": {
    "target": "es2016",
    "module": "commonjs",
    "lib": ["esnext"],
    "strict": true,
    "rootDir": ".",
    "noEmit": true,
    "plugins": [
      {
        "name": "nexus/typescript-language-service"
      }
    ],
    "typeRoots": ["node_modules/@types", "types"]
  },
  "include": ["types.d.ts", "."]
}

And my tree structure is according to the old Prisma-Nexus combo:

.
├── README.md
├── node_modules
├── package-lock.json
├── package.json
├── prisma
│   ├── blogs.json
│   ├── dev.db
│   ├── migrations
│   ├── schema.prisma
│   ├── seed.js
│   └── writeToFile.js
├── src
│   ├── app.js
│   ├── index.js
│   └── schema.graphql
└── tsconfig.json

The src/app.js is my entry point as specified in the new Nexus.

I'd love to know how to solve this little issue?

@Weakky
Copy link
Collaborator

Weakky commented Jun 30, 2020

Hey @deadcoder0904, we indeed do not support Javascript yet. Please refer to this issue (#85) in order to track its development.

Closing for now as there is unfortunately no solution to your problem until we support JS.

@Weakky Weakky closed this as completed Jun 30, 2020
@deadcoder0904
Copy link
Author

@Weakky any ETA or should I convert to TS?

@Weakky
Copy link
Collaborator

Weakky commented Jun 30, 2020

No ETA that I can give you right now. Your best option for now would be to switch to TS indeed 🙏

@deadcoder0904
Copy link
Author

Just switched to TS. Wasn't too much of a hassle. Just had to change .js to .ts :)

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

No branches or pull requests

2 participants