papr: `types.array()` after on any version `10.1.0` breaks WebStorm inspection

Just a weird issue when using WebStorm and creating an schema with types.array(). It works normally on 10.1.0 but not on any newer versions.

I’m creating this issue with the hope someone also has this issue and so we can discuss and figure out a solution together. I tried everything, even using a different PC, but as soon as a types.array() is added to the code, WebStorm stops inspecting every file related to the schema file (that imported the it).

My theory is that it is having difficult interpreting the TypeScript behind it. Maybe a loop introduced somewhere?

The WebStorm version I’m using is 2023.1.1.

And TypeScript version is 4.9.5.

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 15 (2 by maintainers)

Most upvoted comments

@italodeandra - I checked out your repo, and I also built an even simpler repo to try to reproduce the issue.

I started with my simple repo by doing everything in one file. In the index.ts I instantiated Papr and declared the Asset model and added a query. This didn’t reproduce the issue.

Then I added some structure:

src
|____index.ts
|____database
| |____papr.ts
| |____models
| | |____Asset.ts

and that reproduced the issue.

After some digging in tsconfig.json file, adding "baseUrl": "./" to the compilerOptions solved the problem.

I did try to spend some time to understand why, unlike Webstorm, VSCode was not chocking on this, but I got nothing specific. I am guessing it is because some Webstorm feature like inlay hints, or something similar, and with the lack of "baseUrl": "./", webstorm gets into some infinite loop trying to resolve types. 🤷 idk, it is just a guess.

I found this ticket on YouTrack, and I added a comment there with a link to the simple repro repo. Hopefully the folks at JetBrains will be able to highlight what was causing Webstorm to chock on the lack of "baseUrl": "./", but in the mean time, I hope that unblocks you.