graphql / graphql/graphiql

[graphiql] build issues

Open
#4,173 0 comments 0 reactions 0 assignees View on GitHub
bug graphiql
Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
22h 45m
Merged PRs (30d)
70

Description

### Is there an existing issue for this?

- [x] I have searched the existing issues

### Current Behavior

### GRAPHIQL'S BUILD SCRIPT
Not sure but I think there might be something off with the build - while working on trying to submit a couple pr's within the project, the yarn build command kept logging errors...

Image

### YARN PNP
Not sure if this is related or just a pnp issue but I a yarn pnp project using graphiql I work on -

if I just do a basic setup it worked -
```
export function GraphiQLPage() {
return ;
}
```

but if I do more complex setup it did not -
```
function InsideContext() {
return ;
}
export function GraphiQLPage() {
return (



);
}
```
I also couldn't get a custom worker setup so I ended up just switching to node modules to get everything working.

### JEST

Not sure if this is related or not either, but a yarn project using graphiql I work on tests did not work well with jest and kept giving errors, I ended up getting it working like this, but not sure if there's something off with the build or if it's because of esm and jest not quite right yet
```
jest.unstable_mockModule(module, () => ({
__esModule: false,
...jest.requireActual('graphiql') as any
}));
```

### Expected Behavior

_No response_

### Steps To Reproduce

for build
run the yarn build script in the graphiql repo

for pnp
https://codesandbox.io/p/devbox/esbuild-monaco-pnp-forked-sjmwrs?workspaceId=ws_KAhPd9i23CnV7Pt56mXjER

in this codesandbox - run yarn, yarn build:client, yarn build:server

### Environment

* GraphiQL Version:
* OS:
* Browser:
* Bundler:
* `react` Version:
* `graphql` Version:

### Anything else?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.