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

Using the code from the given example results in "Type instantiation is excessively deep and possibly infinite" error #95

Closed
jainil opened this issue May 18, 2022 · 3 comments

Comments

@jainil
Copy link

jainil commented May 18, 2022

I created a starter typescript project and added the example file from the readme to test this out. However I am getting the following error for UserSchema:

Type instantiation is excessively deep and possibly infinite. ts(2589)

Is this an issue with the lib or my config?

My tsconfig:

{
  "compilerOptions": {
    "outDir": "dist",
    "baseUrl": ".",
    "declaration": true,
    "module": "commonjs",
    "target": "es6",
    "noEmitOnError": true,
    "sourceMap": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true
  },
  "include": [
    "src"
  ],
  "exclude": [
    "node_modules",
    "dist"
  ]
}
@jainil
Copy link
Author

jainil commented May 18, 2022

Found a corresponding report on mongoose repo regarding this issue: Automattic/mongoose#11787

For now fixing mongoose version to 6.3.1 solves the problem for me.

Closing since this is an upstream issue.

@jainil jainil closed this as completed May 18, 2022
@francescov1
Copy link
Owner

Thanks @jainil. Ill keep an eye on the upstream issue and make any required updates if needed.

@francescov1
Copy link
Owner

@jainil Note that this issue has been resolved in newer Mongoose versions, so if you want to upgrade your Mongoose version you can do so (must be 6.4.1 or higher)

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