TriPSs / nestjs-query

Easy CRUD for GraphQL.
https://tripss.github.io/nestjs-query/
MIT License
152 stars 43 forks source link

Issue with types missing, possibly incorrectly published package??? #48

Closed smolinari closed 1 year ago

smolinari commented 1 year ago

I'm getting back to my project after several months and I'm bogged down with a couple of issues from nestjs-query-typegoose and to be honest, I'm not sure it's just my incompetence or what.

At any rate, this error is happening while building/ compiling:

src/user/user.module.ts(2,44): error TS7016: Could not find a declaration file for module '@ptc-org/nestjs-query-typegoose'. '/home/scott/Documents/tmp/m8a-new/common/temp/node_modules/.pnpm/@ptc-org+nestjs-query-typegoose@1.1.0_aefggeysizmixjxhkqtfgu72mu/node_modules/@ptc-org/nestjs-query-typegoose/src/index.js' implicitly has an 'any' type. Try npm i --save-dev @types/ptc-org__nestjs-query-typegoose if it exists or add a new declaration (.d.ts) file containing declare module '@ptc-org/nestjs-query-typegoose';

This happens when I have strict: true set. If I set it to "off", the build goes through with no errors, but then I get this error while running my app:

Error: Cannot find module './module' Require stack:

It's like the package wasn't built properly to begin with???

Have you read the Contributing Guidelines?

Yes

To Reproduce Steps to reproduce the behavior:

Don't have any reproduction repo. Sorry. If it is a prerequisite, let me know.

Expected behavior I'm expecting none of these errors.

Desktop (please complete the following information):

I hope you can help me on this, as it's blocking any further work. Thanks!

Scott

TriPSs commented 1 year ago

I think there are indeed some publishing issues with Typegoos, thought I fixed those but will check it out. Will also check the any it's complaining about.

smolinari commented 1 year ago

Awesome.... thank you! @TriPSs

Scott

smolinari commented 1 year ago

@TriPSs - When do you think you can get to this or have you started working on it? I have a bit of time and can try myself to get the Typegoose package up-to-date.

Scott

TriPSs commented 1 year ago

@smolinari that would be awesome! The earliest for me would be the end of next week.

smolinari commented 1 year ago

@TriPSs - Ok. I'm giving it a shot. It looks like everything builds and tests ok. I also upped the deps as in the PR I wrote.

I think the issue must be in how you published the package to npm.

I noticed in the package.json of query-typegoose the following setting is different than in the other packages:

  "files": [
    "dist/src/**"
  ],

Everywhere else it is:

    "files": [
    "src/**"
  ],

I think that is the culprit, maybe?

Scott

TriPSs commented 1 year ago

Makes sense indeed

smolinari commented 1 year ago

@TriPSs - Any chance you could re-publish the query-typegoose package if I post a PR with the changes?

Scott