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

disable prerender in appdir #44582

Closed
stephen-dahl opened this issue Jan 5, 2023 · 4 comments
Closed

disable prerender in appdir #44582

stephen-dahl opened this issue Jan 5, 2023 · 4 comments

Comments

@stephen-dahl
Copy link

stephen-dahl commented Jan 5, 2023

inside of a /app/page.tsx I have

export const dynamic = "force-dynamic";

const SearchPage = async () => {
  const fileName = "../data/repoInfo.json";
  const fileText = await readFile(fileName, { encoding: "utf-8" });
  const components = JSON.parse(fileText) as Component[];
  return <ComponentSearch components={components} />;
};

How can I disable prerender on this file since the data file does not exist at build time?

Originally posted by @stephen-dahl in #41745 (comment)

@lluzak
Copy link

lluzak commented Jan 7, 2023

@stephen-dahl did you try ?

export const dynamic = "force-dynamic";
export const revalidate = 0;

@stephen-dahl
Copy link
Author

thought I did but it is working now, must have tried them separately

@logemann
Copy link

thought I did but it is working now, must have tried them separately

makes sense to close this one right?

@github-actions
Copy link
Contributor

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants