Gatsby: Cannot read property 'page' of undefined when renaming a page in develop

Created on 19 Jan 2020  路  9Comments  路  Source: gatsbyjs/gatsby

Description

Gatsby throws an error when going to page-2 after renaming from default template.

Steps to reproduce

ran "gatsby new mysite" -> gatsby develop -> renamepage-2.js to page-3.js and the link in index.js from /page-2/ to /page-3/ -> stop gatsby with ctrl+c -> start gatsby with gatsby develop -> go to http://localhost:8000/page-2/ and see error

Expected result

It shouldn't error

Actual result

it errored

Environment

System:
OS: Linux 4.4 Ubuntu 18.04.3 LTS (Bionic Beaver)
CPU: (6) x64 Intel(R) Core(TM) i5-9600K CPU @ 3.70GHz
Shell: 4.4.20 - /bin/bash
Binaries:
Node: 12.2.0 - ~/.nvm/versions/node/v12.2.0/bin/node
npm: 6.13.0 - ~/.nvm/versions/node/v12.2.0/bin/npm
Languages:
Python: 2.7.15+ - /usr/bin/python
npmPackages:
gatsby: ^2.18.12 => 2.18.12
gatsby-image: ^2.2.34 => 2.2.34
gatsby-plugin-manifest: ^2.2.31 => 2.2.31
gatsby-plugin-offline: ^3.0.27 => 3.0.27
gatsby-plugin-react-helmet: ^3.1.16 => 3.1.16
gatsby-plugin-sharp: ^2.3.5 => 2.3.5
gatsby-source-filesystem: ^2.1.40 => 2.1.40
gatsby-transformer-sharp: ^2.3.7 => 2.3.7
npmGlobalPackages:
gatsby-cli: 2.8.27

stale? confirmed bug

Most helpful comment

To clarify your issue: One doesn't see the 404 page from Gatsby but an unrelated error as it's still in .cache. A gatsby clean resolves the issue.

All 9 comments

To clarify your issue: One doesn't see the 404 page from Gatsby but an unrelated error as it's still in .cache. A gatsby clean resolves the issue.

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Replying to keep open.

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

FWIW I saw this too and running rm -rf ./.cache and restarting npm run develop didn't work for me but running gatsby clean did. I don't know if gatsby clean is doing some magic.

gatsby clean removes public folder, either use clean or remove manually .cache and public folders.

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.
If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.
Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.
As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community! 馃挭馃挏

FWIW I saw this too and running rm -rf ./.cache and restarting npm run develop didn't work for me but running gatsby clean did. I don't know if gatsby clean is doing some magic.

gatsby clean worked for me too

Was this page helpful?
0 / 5 - 0 ratings

Related issues

benstr picture benstr  路  3Comments

Oppenheimer1 picture Oppenheimer1  路  3Comments

ferMartz picture ferMartz  路  3Comments

timbrandin picture timbrandin  路  3Comments

signalwerk picture signalwerk  路  3Comments