-
Notifications
You must be signed in to change notification settings - Fork 155
Description
Description
Problem Description
During Next.js build process (next build), we're seeing deprecation warnings from Apollo Client 3.14.0 related to deprecated options canonizeResults and cache.diff. These warnings are being generated by Faust.js's internal Apollo Client usage during getWordPressProps calls.
Error Messages
The following warnings appear multiple times during the build output:
An error occurred! For more details, see the full error text at https://go.apollo.dev/c/err#%7B%22version%22%3A%223.14.0%22%2C%22message%22%3A104%2C%22args%22%3A%5B%22cache.diff%22%2C%22canonizeResults%22%2C%22Please%20remove%20this%20option.%22%5D%7D
Decoded error details:
- Error Code: 104
- Deprecated Options:
cache.diff,canonizeResults - Message: "Please remove this option."
Environment
Frontend (Next.js)
- Faust.js Core:
@faustwp/[email protected] - Faust.js CLI:
@faustwp/[email protected] - Apollo Client Version:
@apollo/[email protected](resolved via yarn resolutions) - Next.js Version:
15.0.0 - Node Version:
20.x
Backend (WordPress)
- WordPress Version:
6.6.1 - FaustWP Plugin Version:
1.8.0
Root Cause
The warnings originate from Faust.js's internal Apollo Client instances created during:
getWordPressProps()calls ingetStaticProps- Server-side rendering operations
These internal Apollo Client instances appear to be using deprecated options (canonizeResults and cache.diff) that were:
- Deprecated in Apollo Client 3.11
- Removed in Apollo Client 3.14
Impact
- Build Status: ✅ Builds complete successfully (warnings only, not errors)
- Functionality: ✅ No functional impact observed
- Developer Experience:
⚠️ Build output is cluttered with repeated warnings
Steps to Reproduce
-
Setup a Next.js project with Faust.js:
# Install dependencies yarn add @faustwp/core@^3.0.1 @apollo/client@^3.10.5 next@^15.0.0 # Add yarn resolution to ensure Apollo Client 3.14.0 # In package.json: "resolutions": { "@apollo/client": "3.14.0" } yarn install
-
Create a page using
getWordPressProps:// pages/[...wordpressNode].tsx import { getWordPressProps, WordPressTemplate } from '@faustwp/core' import { GetStaticProps } from 'next' export default function Page(props) { return <WordPressTemplate {...props} /> } export const getStaticProps: GetStaticProps = (ctx) => { return getWordPressProps({ ctx, revalidate: 600, }) }
-
Run the build:
yarn build
-
Observe warnings in build output - The warnings will appear multiple times during static page generation, once for each page that uses
getWordPressProps().
Note: The warnings only appear during build (next build), not during development (next dev). This is because getStaticProps runs during the build process.
Expected Behavior
- No deprecation warnings during build
- Faust.js's internal Apollo Client instances should use Apollo Client 3.14+ compatible options
Suggested Solution
Update Faust.js's internal Apollo Client configuration to:
- Remove any usage of
canonizeResultsoption inInMemoryCacheconfiguration - Remove any usage of
cache.diffmethod - Ensure all
InMemoryCacheinstances are created without deprecated options
Additional Context
We've already:
- ✅ Updated our own Apollo Client instances to explicitly configure
InMemoryCachewithout deprecated options - ✅ Added yarn resolution to ensure consistent Apollo Client version (
@apollo/[email protected]) - ✅ Verified warnings are coming from Faust.js's internal usage, not our code
- ✅ Confirmed the warnings appear regardless of our own Apollo Client configuration
Verification:
- We searched our codebase and confirmed we're not using
canonizeResultsorcache.diffanywhere - The warnings persist even after updating all our
InMemoryCacheinstances to explicitly avoid deprecated options - The warnings only appear during build when
getWordPressProps()is called, not during development
The warnings are non-blocking but should be addressed to maintain compatibility with Apollo Client 3.14+ and future versions.
Related Issues
- Apollo Client 3.11: Deprecated
canonizeResults(Release Notes) - Apollo Client 3.14: Removed deprecated options (Release Notes)
Note: This is a good citizen issue report. We're happy to help test any fixes or provide additional information if needed.
Steps to reproduce
above
Additional context
above
@faustwp/core Version
3.3.2
@faustwp/cli Version
3.3.1
FaustWP Plugin Version
1.8.0
WordPress Version
6.6.1
Additional environment details
No response
Please confirm that you have searched existing issues in the repo.
- Yes
Metadata
Metadata
Assignees
Labels
Type
Projects
Status