question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Preact routing doesn't work well with Gatsby

See original GitHub issue

Description

When I click on link (Gatsby Link component), URL in searchbar is changing, but page doesn’t change

Steps to reproduce

  • Install Preact (using official plugin instruction)
  • Use a Link component on the page
  • Run build command
  • Click on the link

Expected result

URL changes and new page appears.

Actual result

Page remains, but you’ll get a new URL.

Environment

  System:
    OS: Windows 10
    CPU: (4) x64 Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz
  Binaries:
    npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD
  Languages:
    Python: 2.7.16
  Browsers:
    Edge: 44.18362.329.0
  npmPackages:
    gatsby: ^2.9.4 => 2.13.50
    gatsby-image: ^2.1.4 => 2.2.8
    gatsby-plugin-feed: ^2.2.3 => 2.3.6
    gatsby-plugin-manifest: ^2.1.1 => 2.2.4
    gatsby-plugin-offline: ^2.1.3 => 2.2.4
    gatsby-plugin-react-helmet: ^3.0.12 => 3.1.2
    gatsby-plugin-sass: ^2.1.0 => 2.1.4
    gatsby-plugin-sharp: ^2.1.5 => 2.2.9
    gatsby-plugin-sitemap: ^2.1.0 => 2.2.5
    gatsby-plugin-twitter: ^2.1.2 => 2.1.2
    gatsby-remark-images: ^3.0.16 => 3.1.7
    gatsby-remark-prismjs: ^3.3.1 => 3.3.4
    gatsby-remark-relative-images: ^0.2.3 => 0.2.3
    gatsby-remark-responsive-iframe: ^2.2.8 => 2.2.8
    gatsby-source-filesystem: ^2.0.39 => 2.1.8
    gatsby-transformer-remark: ^2.5.0 => 2.6.10
    gatsby-transformer-sharp: ^2.1.21 => 2.2.5

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
persoconcommented, Oct 22, 2020

@wardpeet HEHEHEHEHEHEHE THAT WORKS!!! daaaamn life saver 😃 thanks a lot ❤️

1reaction
wardpeetcommented, Oct 20, 2020

@persocon are you sure you’ve updated to latest gatsby & plugin-preact? I know we had an issue with the jsx-runtime check that react and babel had introduced

https://reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using Web Components with Gatsby and Preact - Ryosuke
As I've been working with Web Components, I've been trying to find a compatible workflow that is easy to use and efficient.
Read more >
Routing not working using Gatsby - reach-router
I'm trying to render a blog as a card then open it up as a page , but its proving ...
Read more >
Gatsby Changelog | 5.3.0
In PR #36623 we fixed this behavior and any node changes (either by changing local files or through webhook updates) will be reflected...
Read more >
Gatsby: The ultimate guide with examples - LogRocket Blog
This tutorial covers everything you'll ever need to know about Gatsby, including code demos and comparisons to React and Next.js.
Read more >
Overview - Reach Router
Reach Router is a small, simple router for React that borrows from React Router, ... have some sort of global chrome/navigation, that works...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found