keystone icon indicating copy to clipboard operation
keystone copied to clipboard

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

Open kamilbiela opened this issue 1 year ago • 8 comments

Steps to reproduce:

  • initialize keystone project
  • add esbuild.keystone.ts file to enable custom esbuild
  • inside esbuild.keystone.ts remove default plugins configuration to bundle all the dependencies

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 :)

kamilbiela avatar Oct 31 '24 10:10 kamilbiela

@kamilbiela can you describe what happens for you?

dcousens avatar Oct 31 '24 21:10 dcousens

@dcousens hey, this: image

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

kamilbiela avatar Oct 31 '24 22:10 kamilbiela

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 avatar Nov 01 '24 09:11 kamilbiela

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

kamilbiela avatar Nov 01 '24 10:11 kamilbiela

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

dcousens avatar Nov 04 '24 04:11 dcousens

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 avatar Nov 04 '24 08:11 kamilbiela

Adding this also didn't change the outcome: image

kamilbiela avatar Nov 04 '24 08:11 kamilbiela

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

kamilbiela avatar Nov 04 '24 10:11 kamilbiela