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

fix(query-core): use performance instead of Date.now to initialize mutationId #8315

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ali-idrizi
Copy link

Previously the MutationCache.#mutationId was initialized with Date.now(). When using dynamicIo with Next it was throwing:

Error: Route "/" used `Date.now()` instead of using `performance` or without explicitly calling `await connection()` beforehand. See more info here: https://nextjs.org/docs/messages/next-prerender-current-time

The error is fixed by using performance.timeOrigin + performance.now() instead.

I have updated the next and react dependencies on the Next 15 integration and example from RC to stable. However, the dynamicIo is still an experimental feature and requires the canary dependency, so this not tested. I can confirm that the error was thrown locally by react-next-15 integration when enabling dynamicIo, and this change fixes it.

Closes #8277

Copy link

nx-cloud bot commented Nov 20, 2024

☁️ Nx Cloud Report

CI is running/has finished running commands for commit efbf935. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this CI Pipeline Execution


🟥 Failed Commands
nx affected --targets=test:sherif,test:knip,test:eslint,test:lib,test:types,test:build,build --parallel=3
✅ Successfully ran 1 target

Sent with 💌 from NxCloud.

Comment on lines +13 to +14
"react": "19.0.0-rc-7ac8e612-20241113",
"react-dom": "19.0.0-rc-7ac8e612-20241113",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we please use 19.0.0-rc.1, and use it everywhere. I’d really like to have the versions streamlined, thanks 🙏

Copy link

pkg-pr-new bot commented Nov 20, 2024

Open in Stackblitz

More templates

@tanstack/angular-query-devtools-experimental

pnpm add https://pkg.pr.new/@tanstack/angular-query-devtools-experimental@8315

@tanstack/angular-query-experimental

pnpm add https://pkg.pr.new/@tanstack/angular-query-experimental@8315

@tanstack/query-async-storage-persister

pnpm add https://pkg.pr.new/@tanstack/query-async-storage-persister@8315

@tanstack/eslint-plugin-query

pnpm add https://pkg.pr.new/@tanstack/eslint-plugin-query@8315

@tanstack/query-broadcast-client-experimental

pnpm add https://pkg.pr.new/@tanstack/query-broadcast-client-experimental@8315

@tanstack/query-core

pnpm add https://pkg.pr.new/@tanstack/query-core@8315

@tanstack/query-devtools

pnpm add https://pkg.pr.new/@tanstack/query-devtools@8315

@tanstack/query-persist-client-core

pnpm add https://pkg.pr.new/@tanstack/query-persist-client-core@8315

@tanstack/query-sync-storage-persister

pnpm add https://pkg.pr.new/@tanstack/query-sync-storage-persister@8315

@tanstack/react-query

pnpm add https://pkg.pr.new/@tanstack/react-query@8315

@tanstack/react-query-devtools

pnpm add https://pkg.pr.new/@tanstack/react-query-devtools@8315

@tanstack/react-query-next-experimental

pnpm add https://pkg.pr.new/@tanstack/react-query-next-experimental@8315

@tanstack/react-query-persist-client

pnpm add https://pkg.pr.new/@tanstack/react-query-persist-client@8315

@tanstack/solid-query

pnpm add https://pkg.pr.new/@tanstack/solid-query@8315

@tanstack/solid-query-devtools

pnpm add https://pkg.pr.new/@tanstack/solid-query-devtools@8315

@tanstack/solid-query-persist-client

pnpm add https://pkg.pr.new/@tanstack/solid-query-persist-client@8315

@tanstack/svelte-query

pnpm add https://pkg.pr.new/@tanstack/svelte-query@8315

@tanstack/svelte-query-devtools

pnpm add https://pkg.pr.new/@tanstack/svelte-query-devtools@8315

@tanstack/svelte-query-persist-client

pnpm add https://pkg.pr.new/@tanstack/svelte-query-persist-client@8315

@tanstack/vue-query

pnpm add https://pkg.pr.new/@tanstack/vue-query@8315

@tanstack/vue-query-devtools

pnpm add https://pkg.pr.new/@tanstack/vue-query-devtools@8315

commit: efbf935

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

Successfully merging this pull request may close these issues.

Next js 15 with dynamicIO: true returned server error
2 participants