Next.js
The Next.js version must be >= 13 for it to work with the Peaze SDK. This is because Next.js does not allow importing external CSS directly from node_modules
. Luckily, Next.js >= 13 provides a new beta feature that allows packages to use their native CSS. Note that additional configuration is required and that this feature is in beta.
The following error will occur if your project is not configured correctly and/or is not using the correct version of Next.js.
Follow the steps below to make Next.js work with the Peaze SDK.
- Ensure that the Next.js version is >= 13.
- Configure the
next.config.js
and ensure that the experimental app feature is enabled.
Example next.config.js
file:
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {appDir: true}, // This line of code enables the app directory
}
module.exports = nextConfig
- Create an
app
directory in thesrc
folder and place the application code here.
Resources:
- Next.js app directory roadmap: https://beta.nextjs.org/docs/app-directory-roadmap
- Next.js app directory config: https://nextjs.org/docs/messages/experimental-app-dir-config
- Primer on new app directory feature: https://nextjs.org/docs/messages/experimental-app-dir-config
Updated 2 days ago