Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
kamilbiela opened this issue Oct 31, 2024 · 8 comments

Comments

@kamilbiela
Copy link

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

@dcousens
Copy link
Member

@kamilbiela can you describe what happens for you?

@dcousens dcousens added the 🐛 bug Unresolved bug label Oct 31, 2024
@kamilbiela
Copy link
Author

@dcousens hey, this:
image

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

@kamilbiela
Copy link
Author

Digging deeper (howtographql/react-apollo#33 (comment)) 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
Copy link
Author

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
Copy link
Member

dcousens commented Nov 4, 2024

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

@dcousens dcousens removed the 🐛 bug Unresolved bug label Nov 4, 2024
@kamilbiela
Copy link
Author

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
Copy link
Author

Adding this also didn't change the outcome:
image

@kamilbiela
Copy link
Author

kamilbiela commented Nov 4, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants