Running into a production deployment-only issue with my Gatsby v4 app (amazing-wiles-1918a6) where I seem to be able to navigate just fine to dynamic routes once I load my page from a non-dynamic route, but if I attempt to navigate directly TO a dynamic route, I get a 404 error and it throws off the rendering of my page.
Example production link currently experiencing the issue as of 12/8/2021 at 12:02AM EST:
https://floridabulldogshockey.com/tournaments/mlk2022
I can navigate to this dynamic page just fine once the site loads from a normal route (youāll see you can click on āResourcesā then select the tournament where you are prompted to login, as opposed to being given a half-rendered/broken page).
I cloned the gatsby-starter-blog repository in an attempt to reproduce the issue in a repository I could make public, and am getting a new error trying to directly load dynamic routes:
https://affectionate-cray-5edd1e.netlify.app/someroute/somepage
{āerrorTypeā:āRuntime.ImportModuleErrorā,āerrorMessageā:āError: Cannot find module ā/var/task/.cache/page-ssrā\nRequire stack:\n- /var/task/.netlify/functions-internal/__dsg/__dsg.js\n- /var/task/__dsg.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.jsā,ātraceā:[āRuntime.ImportModuleError: Error: Cannot find module ā/var/task/.cache/page-ssrāā,āRequire stack:ā,ā- /var/task/.netlify/functions-internal/__dsg/__dsg.jsā,ā- /var/task/__dsg.jsā,ā- /var/runtime/UserFunction.jsā,ā- /var/runtime/index.jsā," at _loadUserApp (/var/runtime/UserFunction.js:202:13)ā,ā at Object.module.exports.load (/var/runtime/UserFunction.js:242:17)ā,ā at Object. (/var/runtime/index.js:43:30)ā,ā at Module._compile (internal/modules/cjs/loader.js:1085:14)ā,ā at Object.Module._extensionsā¦js (internal/modules/cjs/loader.js:1114:10)ā,ā at Module.load (internal/modules/cjs/loader.js:950:32)ā,ā at Function.Module._load (internal/modules/cjs/loader.js:790:12)ā,ā at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)ā,ā at internal/main/run_main_module.js:17:47"]}
Youāll see you can navigate to the base page of https://affectionate-cray-5edd1e.netlify.app/ and click the link for āsomerouteā and the page loads fine.
I followed the necessary instructions here for using Gatsby v4 with Netlify:
Any attention on this from those of you much more familiar with the guts of Netlify and Gatsby than I am will be much appreciated