2023-07-19
1699
#nextjs
Radoslav Stankov
11910
Jul 19, 2023 â‹… 6 min read

Dealing with links in Next.js

Radoslav Stankov Software developer. Head of Engineering at Product Hunt. Organizer of @ReactNotAConf. Speaker. Trying to blog more at blog.rstankov.com 🤖

Recent posts:

Task Scheduling and cron Jobs in Node Using node-cron

Scheduling tasks in Node.js using node-cron

From basic syntax and advanced techniques to practical applications and error handling, here’s how to use node-cron.

Godwin Ekuma
Nov 12, 2024 â‹… 7 min read
Working With The Angular Tree: Flat Vs Nested Trees And More

Working with the Angular tree

The Angular tree view can be hard to get right, but once you understand it, it can be quite a powerful visual representation.

Lewis Cianci
Nov 12, 2024 â‹… 21 min read
Relay logo with an orange circuit-like path on a blue background, representing the Relay GraphQL client. The article covers building real-time applications in Relay 17, including features like optimistic UI updates, GraphQL subscriptions, and Relay Resolvers.

Building a real-time application with Relay 17

Build a fast, real-time app with Relay 17 to leverage features like optimistic UI updates, GraphQL subscriptions, and seamless data syncing.

Alec Brunelle
Nov 12, 2024 â‹… 9 min read
Vue.js logo over a dark, textured purple background. The article discusses using defineExpose and in Vue 3 to enhance component interaction and enable dynamic theming.

defineExpose and <style vars> in Vue 3 for component interaction and theming

Simplify component interaction and dynamic theming in Vue 3 with defineExpose and for better control and flexibility.

Clara Ekekenta
Nov 7, 2024 â‹… 8 min read
View all posts

2 Replies to "Dealing with links in Next.js"

  1. Hello, im getting 404 when refreshing page to which i’ve navigated using Link with as, i.e. simple any ideas? Using next 9.4.4

  2. It looks like you have a typo in your product path function:

    “`js
    product(product: { id: string }) {
    return {
    href: ‘/products/[id],
    as: `/products/${id}`,
    };
    }
    “`

    You are missing the closing quote for href. I think it should be:

    “`
    product(product: { id: string }) {
    return {
    href: ‘/products/[id]’,
    as: `/products/${id}`,
    };
    }
    “`

    But I’m a PHP guy, so please correct me if I’m wrong.

Leave a Reply