withNextIntl 和 withPlaiceholder 在 NextJS 中不能一起工作

问题描述 投票:0回答:1

我正在使用最新的 NextJS 14。在上面的 next.config.mjs 文件中,我将 nextConfig 包装在两个插件中,但是当我将它们部署到 Vercel 时,它根本无法构建。我对这种情况比较陌生,所以我停止使用 plaiceholder,转而使用 Jimp 来模糊我的图像,效果很流畅。尽管如此,我想知道这里的解决方案是什么,以防我想再次使用此设置。

import createNextIntlPlugin from "next-intl/plugin";
import withPlaiceholder from "@plaiceholder/next";

const withNextIntl = createNextIntlPlugin();

/** @type {import('next').NextConfig} */
const nextConfig = {
  images: {
    remotePatterns: [
      {
        hostname: "firebasestorage.googleapis.com",
      },
      {
        protocol: "https",
        hostname: "cdn.sanity.io",
      },
    ],
  },
  env: {
    POSTGRES_PRISMA_URL: process.env.POSTGRES_PRISMA_URL,
    POSTGRES_URL_NON_POOLING: process.env.POSTGRES_URL_NON_POOLING,
  },
};


export default withPlaiceholder(withNextIntl(nextConfig));
javascript node.js typescript next.js next-intl
1个回答
0
投票

我停止使用 plaiceholder,因此改用 Jimp 来模糊我的图像,并使用 Redis 来缓存它,效果很流畅。

© www.soinside.com 2019 - 2024. All rights reserved.