simenandre / nestjs-envalid

Simple wrapper on top of envalid for NestJS
Apache License 2.0
25 stars 1 forks source link

Invalid imports in the sample code cause project not to build #5

Closed seantcanavan closed 2 years ago

seantcanavan commented 3 years ago

Describe the bug In the sample code the value of Static is neither declared or imported.

Also, the default config.ts file has no exported member ENVALID.

Finally, one of the imports is pulling in the entire envalid folder from node-modules which is generating additional build errors.

To Reproduce Steps to reproduce the behavior:

  1. Start with a working nestjs project
  2. add "nestjs-envalid": "1.2.0", to package.json
  3. npm install
  4. navigate to project/src and touch env-config.ts
  5. paste in the sample code from https://github.com/cobraz/nestjs-envalid#quickstart

Expected behavior Typescript project builds successfully

Screenshots nestjs_envalid_issue

Desktop (please complete the following information):

simenandre commented 3 years ago

Hello @seantcanavan 👋

Thank for opening this issue! I've seemed to have jumped the fence a bit there, seem to have forgot to export a few things and add a step to the quickstart.

First of all, envalid is a peerDependency. We'll have to add that to the steps. I might be mistaken, but that should take care of your build issues? The ENVALID export should come from nestjs-envalid. I'll look at all this stuff very soon! If you want to open a pull request on this, it would be much appreciated! 👍

Thanks again!

seantcanavan commented 3 years ago

Sorry I'm very new to TS/Angular/NestJS so I don't think I'm qualified to open a bug report

simenandre commented 2 years ago

This should be fixed now :)