Like what we’re doing? Star us on GitHub!

yarn build on wsl-2

mwoodpatrick
last year
1 2

I am trying to build the repo on wsl-2 (ubuntu 20.04) is yarn 3 required for builds if I run with yarn 3.1.1 then the tests pass, however when I run "yarn build" I do get the error below, also if I run "yarn lint" I do get a bunch of errors. Are these expected? If I try to run with yarn 1.23.0 I get a bunch of errors is this expected?

src/globals/buildModel.ts:16:5 - error TS2741: Property 'paginate' is missing in type 'Model<unknown, {}, {}, {}>' but required in type 'PaginateModel<any, {}, {}, {}>'.

16 return Globals;
~~~~~~~~~~~~~~~

node_modules/@types/mongoose-paginate-v2/index.d.ts:78:9
78 paginate(
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
79 query?: FilterQuery,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
...
81 callback?: (err: any, result: PaginateResult<PaginateDocument<T, TMethods, TVirtuals, O>>) => void,
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82 ): Promise<PaginateResult<PaginateDocument<T, TMethods, TVirtuals, O>>>;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'paginate' is declared here.

Found 1 error.

  • denolfe
    Payload Team
    last year

    @mwoodpatrick The fix for this has just been merged with #402 . Let us know if you run into any other issues.

  • denolfe
    Payload Team
    last year

    Thanks for the report @mwoodpatrick. I was able to recreate this on my machine. It's interesting that we're not seeing this in our CI process, which runs yarn build - we're looking into this.

    Regarding the lint script, we added that script for our own knowledge. It is not currently run as part of our CI or build process, so the results are not expected to be error-free. Though, we plan on re-evaluating this in the future.

Open the post
Continue the discussion in GitHub
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More