Tabs on component pages have incorrect paths
See original GitHub issueThe Problem
If you have a pathPrefix
(i.e., https://www.gatsbyjs.org/docs/path-prefix/), then generated paths for component page tabs are incorrect. See here: https://jendowns.github.io/gatsby-theme-carbon/components/accordion/code (make sure there’s no trailing slash, otherwise currentTab
is empty 😬 )
So all of your tab paths on component pages will 404.
Testing Instructions
To demonstrate this, I made a sample repo ( https://github.com/jendowns/gatsby-theme-carbon) by forking gatsby-theme-carbon
and then did this:
- added a github pages deployment for the example site: https://github.com/jendowns/gatsby-theme-carbon/blob/master/packages/example/package.json#L10
- added a
pathPrefix
because my deployment has a subdirectory in the path: https://github.com/jendowns/gatsby-theme-carbon/blob/master/packages/example/gatsby-config.js#L2 - added an “Accordion” test component with typical tabs front matter: https://github.com/jendowns/gatsby-theme-carbon/tree/master/packages/example/src/pages/components/accordion
The key is that you need to deploy to an environment, like Github Pages, that has subdirectories in the path.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Tab nav loading into wrong router-outlet · Issue #4052 - GitHub
In my app.template I have the main router-outlet defined. ... const ROUTES: Routes = [ { path: '', component: ProfileComponent, children: [ {...
Read more >Add and Customize Tabs on Lightning Pages Using the ...
With the Lightning App Builder, you can create, update, delete, and change the order of tabs and tab sets on record and Home...
Read more >Wrong React Routing redirect with tabs - Stack Overflow
it shows main page with tabs. It does not redirect. I tried to solve the problem by taking out error component from tab...
Read more >Solved: Unable to use Tabs Component - Esri Community
Hello! I'm trying to use the <Tabs> component in a custom widget on ExB dev edition 1.5. The component is defined on the...
Read more >UI Builder - Record Page Tabs component: Hide - ServiceNow
Hi all, i am working on a workspace and they would like to have the overview tab gone from the page. Is there...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m pretty sure I know what’s up. Hoping to get this out tomorrow.
Hey Jen! We can (and should) have brought the path prefix in by default there, I’ll check it out.