Skip to content

plugin-remove-trailing-slashes clashes with dev-404-page #3521

@ahmadnassri

Description

@ahmadnassri

Description

When using the gatsby-plugin-remove-trailing-slashes plugin, the dev-404-page throws in an error:

TypeError: Cannot read property 'componentChunkName' of undefined

this can be traced back here:

const dev404Page = pages.find(p => p.path === `/dev-404-page/`)
return createElement(Route, {
key: `404-page`,
component: props =>
createElement(
syncRequires.components[dev404Page.componentChunkName],
{
...props,
...syncRequires.json[dev404Page.jsonName],
}
),
})

Environment

Gatsby version: 1.1.28
Node.js version: 9.4.0
Operating System: Linux

File contents (if changed):

gatsby-config.js:

plugins: ['gatsby-plugin-remove-trailing-slashes']

Actual result

dev-404-page throws a TypeError exception

Expected behavior

should see dev mode 404 page

Steps to reproduce

1. add gatsby-plugin-remove-trailing-slashes to plugins

2. attempt to load a no match route

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions