Hello,
I am refactoring my personal website in a cleaner way with Next.js 13.2, and facing an issue when reproducing what I have previously done for the Internationalization of my website.
I am getting an error that I have never had before:
throw new PrismicError.PrismicError("A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.", void 0, void 0);
^
PrismicError: A valid fetch implementation was not provided. In environments where fetch is not available (including Node.js), a fetch implementation must be provided via a polyfill or the `fetch` option.
Current versions used:
"@prismicio/helpers": "^2.3.9",
"@types/node": "20.3.0",
Here is my next.config.js:
const prismic = require('@prismicio/client')
const sm = require('./slicemachine.config.json')
const localeOverrides = {
'fr-fr': 'fr'
}
/** @type {import('next').NextConfig} */
const nextConfig = async () => {
const client = prismic.createClient(sm.repositoryName)
const repository = await client.getRepository()
// const locales = repository.languages.map((lang) => lang.id)
const locales = repository.languages.map(
(lang) => localeOverrides[lang.id] || lang.id
)
return {
reactStrictMode: true,
i18n: {
// These are all the locales you want to support in
// your application
locales,
// This is the default locale you want to be used when visiting
// a non-locale prefixed path e.g. `/hello`
defaultLocale: locales[0]
},
images: {
domains: ['images.prismic.io', 'images.unsplash.com', 'tailwindui.com']
}
}
}
module.exports = nextConfig
Thanks for the help!