Skip to content

[graphiql] build issues #4173

@lesleydreyer

Description

@lesleydreyer

Is there an existing issue for this?

  • 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 <GraphiQL fetcher={fetcher} />;
}

but if I do more complex setup it did not -

function InsideContext() {
  return <GraphiQLInterface />;
}
export function GraphiQLPage() {
  return (
      <GraphiQLProvider
        plugins={[HISTORY_PLUGIN, DOC_EXPLORER_PLUGIN]}
        fetcher={fetcher}
      >
        <InsideContext />
      </GraphiQLProvider>
  );
}

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions