Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefetch error for dynamic route #16

Open
e16m opened this issue Nov 13, 2022 · 4 comments
Open

Prefetch error for dynamic route #16

e16m opened this issue Nov 13, 2022 · 4 comments

Comments

@e16m
Copy link

e16m commented Nov 13, 2022

I'm seeing an issue at this point in the tutorial:

function Note({ note }: any) {
  const { id, title, content, created } = note || {};

  return (
    **<Link href={`/notes/${id}`}>**
      <div className={styles.note}>
        <h2>{title}</h2>
        <h5>{content}</h5>
        <p>{created}</p>
      </div>
    </Link>
  );
}

When I change it to "/" or "/notes" it works fine, but when I try to do this I get the following error:

PREFETCH ERROR Error: Functions cannot be passed directly to Client Components because they're not serializable.

Does anyone know how to handle this error? I have been researching this for the past few hours but no luck so far.. thanks.

@suti1979
Copy link

same here... :(

@jameshd
Copy link

jameshd commented Nov 23, 2022

Yep same here. I found deleting the error.tsx got rid of it... not sure why it happens though...

@jameshd
Copy link

jameshd commented Nov 23, 2022

#3 this fixes it... basically 'use client';

@e16m
Copy link
Author

e16m commented Nov 24, 2022

@jameshd thanks for sharing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants