edgedb / edgedb-js

The official TypeScript/JS client library and query builder for EdgeDB
https://edgedb.com
Apache License 2.0
510 stars 65 forks source link

Nest.js import troubles #243

Closed Brandutchmen closed 2 years ago

Brandutchmen commented 2 years ago

Trying import e from '../dbschema/edgeql-js/index'; causes my nest project to never build.

tsconfig.build.json

{
  "extends": "./tsconfig.json",
  "exclude": ["node_modules", "test", "dist", "**/*spec.ts", "dbschema"]
}

tsconfig.json


{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "target": "es2017",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
    "skipLibCheck": true,
    "strictNullChecks": false,
    "noImplicitAny": false,
    "strictBindCallApply": false,
    "forceConsistentCasingInFileNames": false,
    "noFallthroughCasesInSwitch": false,
    "strict": true,
    "downlevelIteration": true,
  }
}

nest-cli.json

{
  "collection": "@nestjs/schematics",
  "sourceRoot": "src"
}

I have a feeling I'm missing something simple with this... Thoughts?

busheezy commented 2 years ago

Try with

    "noImplicitAny": true,
    "strictNullChecks": true
Brandutchmen commented 2 years ago

This solved my problem!

Also, for future reference, I added "strictPropertyInitialization": false as well.

busheezy commented 2 years ago

Try to change things to first_name!: string , id!: string and such to force it.

edit: you can also do what you did in your last message but I would probably add the "!" myself so it isn't disabling it globally.