Bläddra i källkod

fix: image use not config host caused page crash (#19590)

tags/1.4.0
Joel 5 månader sedan
förälder
incheckning
65e9f6651c
Inget konto är kopplat till bidragsgivarens mejladress
1 ändrade filer med 13 tillägg och 0 borttagningar
  1. 13
    0
      web/next.config.js

+ 13
- 0
web/next.config.js Visa fil

}, },
}) })


// the default url to prevent parse url error when running jest
const remoteImageURL = new URL(`${process.env.NEXT_PUBLIC_WEB_PREFIX || 'http://localhost:3000'}/**`)

/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {
basePath, basePath,
productionBrowserSourceMaps: false, // enable browser source map generation during the production build productionBrowserSourceMaps: false, // enable browser source map generation during the production build
// Configure pageExtensions to include md and mdx // Configure pageExtensions to include md and mdx
pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'], pageExtensions: ['ts', 'tsx', 'js', 'jsx', 'md', 'mdx'],
// https://nextjs.org/docs/messages/next-image-unconfigured-host
images: {
remotePatterns: [{
protocol: remoteImageURL.protocol.replace(':', ''),
hostname: remoteImageURL.hostname,
port: remoteImageURL.port,
pathname: remoteImageURL.pathname,
search: '',
}],
},
experimental: { experimental: {
}, },
// fix all before production. Now it slow the develop speed. // fix all before production. Now it slow the develop speed.

Laddar…
Avbryt
Spara