Comments (3)
cache()
(and use()
too) seem to be unreleased React features that are not in React 18.2. I think their inclusion is a mistake.
See the RFC for use()
which includes a description of cache()
from nextjs-blog-cms-sanity-v3.
these functions are added by the next runtime, see node_modules/next/types/index.d.ts
// Extend the React types with missing properties
declare module 'react' {
// <html amp=""> support
interface HtmlHTMLAttributes<T> extends React.HTMLAttributes<T> {
amp?: string
}
// <link nonce=""> support
interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
nonce?: string
}
function use<T>(promise: Promise<T> | React.Context<T>): T
function cache<T extends Function>(fn: T): T
}
it seems that through their close working relationship with the core react team they added these earlier to the experimental-edge runtime.
that means that they should work in theory (and they actually do on my end).
from nextjs-blog-cms-sanity-v3.
I could reproduce your issue by following the steps in the readme. It seems the issue is that these functions are only available with the nextjs appDir function that's currently in beta, and this template has moved off of it today.
so this was caused by #186 but the long-term fix would be to remove the use of use()
and cache()
from the OpenGraphPreview
component.
a short-term workaround is to remove line 58-75 from the schemas/settings/index.ts
file. those lines are:
defineField({
name: 'ogImage',
title: 'Open Graph Image',
description:
'Used for social media previews when linking to the index page.',
type: 'object',
components: {
input: OpenGraphInput as any,
},
fields: [
defineField({
name: 'title',
title: 'Title',
type: 'string',
initialValue: demo.ogImageTitle,
}),
],
}),
this will remove the offending component from the settings page
from nextjs-blog-cms-sanity-v3.
Related Issues (20)
- Error on Sanity studio HOT 1
- "Loading... Click here to exit preview mode." incorrectly displayed on all Post pages HOT 1
- Unable to deploy the studio HOT 2
- metadata tags not showing in source HTML
- Only when preview mode is on, the newly added slug page can be seen. HOT 5
- Safari 12 – SyntaxError: Unexpected token '?' HOT 1
- Workspace not defined HOT 3
- How do I make it dark theme? HOT 1
- categoris HOT 1
- Bug with Image Upload -- field gets unset HOT 1
- Feature: Dynamically generated XML sitemap (offering to help) HOT 1
- Feature: Extending PortableText component to support images in PostBody (offering to help) HOT 1
- isValidSignature always fails HOT 2
- next/navigation is not a package
- Gap Appears on Right Side of Screen in Mobile View HOT 1
- /app directory version HOT 4
- Improper implementation of notFound api, version implemented is for app directory
- Typing issues in authors.ts, postBody and postTitle.tsx files
- Sitemap.xml.tsx? HOT 4
- App directory update HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nextjs-blog-cms-sanity-v3.