keystonejs / keystone

The superpowered headless CMS for Node.js — built with GraphQL and React
https://keystonejs.com
MIT License
9.3k stars 1.16k forks source link

keystone build command: Impossible to bundle all files using custom esbuild config #9384

Open kamilbiela opened 4 weeks ago

kamilbiela commented 4 weeks ago

Steps to reproduce:

Expected:

it builds the project

Context:

Minimal repository: https://github.com/kamilbiela/keystone-graphql-issue

Custom esbuild file: https://github.com/kamilbiela/keystone-graphql-issue/blob/main/esbuild.keystone.ts

Github runner action output: https://github.com/kamilbiela/keystone-graphql-issue/actions/runs/11610130875/job/32328818149

Am I doing something wrong here? I really would like to bundle all the dependencies because my original setup uses a mono repo, and this would greatly simplify the whole build and deploy pipeline.

Thank you for the help :)

dcousens commented 4 weeks ago

@kamilbiela can you describe what happens for you?

kamilbiela commented 4 weeks ago

@dcousens hey, this: image

(it's from the "Github runner action output link")

kamilbiela commented 4 weeks ago

Digging deeper (https://github.com/howtographql/react-apollo/issues/33#issuecomment-426096917) I did set export NODE_ENV="production" and it makes this error go away.

Now there is this: image

Note: this is building against boilerplate code without any modification

kamilbiela commented 4 weeks ago

After removing all "relationship" fields there is different error: image

And after leaving only User list and setting all of the fields to isOrderable: false there is this error: image

dcousens commented 3 weeks ago

@kamilbiela please verify that you only have 1 version of graphql installed/resolving

kamilbiela commented 3 weeks ago

I'm giving errors from a repository initialized with npm create keystone-app@latest where the only change is that I want to package all deps with esbuild.

I did set up GitHub Runner with this minimal repository, and it replicates my local issue of not being able to package all dependencies with the esbuild. All the links are in the original description.

This is latest run: https://github.com/kamilbiela/keystone-graphql-issue/actions/runs/11660520546/job/32463003633 image

I don't understand why the label bug was removed. Thanks for the help :)

kamilbiela commented 3 weeks ago

Adding this also didn't change the outcome: image

kamilbiela commented 3 weeks ago

to summarize the build problem.

With NODE_ENV=production the graphql error goes away.

But it does make another problem appear (this is with the example keystone code): image