In what circumstances is onRenderBody not run?

Viewed 215
1 Answers

Have you tried ES6 notation?

Instead of :

exports.onRenderBody = (
  { setHeadComponents, pathname = `/` },
  { crossOrigin = `anonymous` } = {}
) => {

Do:

import React from "react"

export const onRenderBody = (
    { setHeadComponents, pathname = `/` },
    { crossOrigin = `anonymous` } = {}
) => {

It seems that some webpack versions prevent the triggering of some SSR functions.

Interesting/related threads:

Related