Skip to content

Build fails when I have an SSR page and gatsby-source-contentful working together #37632

@fedehub93

Description

@fedehub93

Preliminary Checks

Description

When I run the build with gatsby build I receive the ERROR #98001 and Error: Worker exited before finishing task.
I've noticed this problem using the gatsby-source-contentful-plugin with an SSR page.
As I remove the SSR page everything works fine.
Similarly disabling gatsby-source-contentful and leaving the SSR page everything works fine.

I also tested this with gatsby@next.

Reproduction Link

https://github.com/fedehub93/gatsby-contentful-ssr-page

Steps to Reproduce

  1. npm init gatsby, I choose typescript configuration
  2. yarn add gatsby-source-contentful gatsby-plugin-image gatsby-plugin-sharp gatsby-transformer-sharp
  3. configure gatsby-config.ts with plugins and put your spaceId and accessToken in gatsby-source-contentful options:
  plugins: [
    {
      resolve: "gatsby-source-contentful",
      options: {
        spaceId: "<PUT_YOUR_SPACE_ID>",
        accessToken: "<PUT_YOUR_ACCESS_TOKEN>",
      },
    },
    `gatsby-plugin-image`,
    `gatsby-plugin-sharp`,
    `gatsby-transformer-sharp`,
  ],
  1. add a new file in src/pages/search.tsx with following code:
import React from "react";
import { GetServerData, PageProps } from "gatsby";

type ServerDataProps = {
  title: string;
};

const Search = ({
  serverData,
}: PageProps<object, object, unknown, ServerDataProps>): JSX.Element => (
  <h1>{serverData.title}</h1>
);

export default Search;

export const getServerData: GetServerData<ServerDataProps> = async (props) => {
  return {
    props: {
      title: "Test SSR",
    },
  };
};

  1. Run gatsby build

Expected Result

The build runs successfully.

Actual Result

I have this error:

failed Validating Rendering Engines - 1.409s

 ERROR #98001  ENGINE.VALIDATION

Built Rendering Engines failed validation failed validation.

Please open an issue with a reproduction at https://gatsby.dev/new-issue for more help.



  Error: Worker exited before finishing task

  - index.js:205 ChildProcess.<anonymous>
    [test-ssr]/[gatsby-worker]/dist/index.js:205:41

Environment

System:
    OS: Windows 10 10.0.19044
    CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
  Binaries:
    Node: 18.0.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 8.6.0 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 3.9.7
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (109.0.1518.78)
  npmPackages:
    gatsby: ^5.6.0 => 5.6.0
    gatsby-plugin-image: ^3.6.0 => 3.6.0
    gatsby-plugin-sharp: ^5.6.0 => 5.6.0
    gatsby-source-contentful: ^8.6.0 => 8.6.0
    gatsby-source-filesystem: ^5.6.0 => 5.6.0
    gatsby-transformer-sharp: ^5.6.0 => 5.6.0

Config Flags

No response

Metadata

Metadata

Assignees

Labels

status: confirmedIssue with steps to reproduce the bug that’s been verified by at least one reviewer.topic: render-modeRelated to Gatsby's different rendering modestype: bugAn issue or pull request relating to a bug in Gatsby

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions