Unverified Commit a3a20dcb authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Add template and error file types (#39808)

Co-authored-by: 's avatarJiachi Liu <inbox@huozhi.im>
parent 9ab5c012
import type webpack from 'webpack' import type webpack from 'webpack'
import type { ValueOf } from '../../../shared/lib/constants'
import { NODE_RESOLVE_OPTIONS } from '../../webpack-config' import { NODE_RESOLVE_OPTIONS } from '../../webpack-config'
import { getModuleBuildInfo } from './get-module-build-info' import { getModuleBuildInfo } from './get-module-build-info'
export const FILE_TYPES = {
layout: 'layout',
template: 'template',
error: 'error',
loading: 'loading',
} as const
// TODO-APP: check if this can be narrowed.
type ComponentModule = () => any
export type ComponentsType = {
readonly [componentKey in ValueOf<typeof FILE_TYPES>]?: ComponentModule
} & {
readonly layoutOrPagePath?: string
readonly page?: ComponentModule
}
async function createTreeCodeFromPath({ async function createTreeCodeFromPath({
pagePath, pagePath,
resolve, resolve,
...@@ -39,7 +56,7 @@ async function createTreeCodeFromPath({ ...@@ -39,7 +56,7 @@ async function createTreeCodeFromPath({
const matchedPagePath = `${appDirPrefix}${parallelSegmentPath}` const matchedPagePath = `${appDirPrefix}${parallelSegmentPath}`
const resolvedPagePath = await resolve(matchedPagePath) const resolvedPagePath = await resolve(matchedPagePath)
// Use '' for segment as it's the page. There can't be a segment called '' so this is the safest way to add it. // Use '' for segment as it's the page. There can't be a segment called '' so this is the safest way to add it.
props[parallelKey] = `['', {}, {filePath: ${JSON.stringify( props[parallelKey] = `['', {}, {layoutOrPagePath: ${JSON.stringify(
resolvedPagePath resolvedPagePath
)}, page: () => require(${JSON.stringify(resolvedPagePath)})}]` )}, page: () => require(${JSON.stringify(resolvedPagePath)})}]`
continue continue
...@@ -50,31 +67,33 @@ async function createTreeCodeFromPath({ ...@@ -50,31 +67,33 @@ async function createTreeCodeFromPath({
parallelSegment, parallelSegment,
]) ])
// For segmentPath === '' avoid double `/` // `page` is not included here as it's added above.
const layoutPath = `${appDirPrefix}${parallelSegmentPath}/layout` const filePaths = await Promise.all(
// For segmentPath === '' avoid double `/` Object.values(FILE_TYPES).map(async (file) => {
const loadingPath = `${appDirPrefix}${parallelSegmentPath}/loading` return [
file,
const resolvedLayoutPath = await resolve(layoutPath) await resolve(`${appDirPrefix}${parallelSegmentPath}/${file}`),
const resolvedLoadingPath = await resolve(loadingPath) ] as const
})
)
props[parallelKey] = `[ props[parallelKey] = `[
'${parallelSegment}', '${parallelSegment}',
${subtree}, ${subtree},
{ {
filePath: ${JSON.stringify(resolvedLayoutPath)}, ${filePaths
${ .filter(([, filePath]) => filePath !== undefined)
resolvedLayoutPath .map(([file, filePath]) => {
? `layout: () => require(${JSON.stringify(resolvedLayoutPath)}),` if (filePath === undefined) {
return ''
}
return `${
file === FILE_TYPES.layout
? `layoutOrPagePath: '${filePath}',`
: '' : ''
} }${file}: () => require(${JSON.stringify(filePath)}),`
${ })
resolvedLoadingPath .join('\n')}
? `loading: () => require(${JSON.stringify(
resolvedLoadingPath
)}),`
: ''
}
} }
]` ]`
} }
...@@ -164,6 +183,7 @@ const nextAppLoader: webpack.LoaderDefinitionFunction<{ ...@@ -164,6 +183,7 @@ const nextAppLoader: webpack.LoaderDefinitionFunction<{
export const AppRouter = require('next/dist/client/components/app-router.client.js').default export const AppRouter = require('next/dist/client/components/app-router.client.js').default
export const LayoutRouter = require('next/dist/client/components/layout-router.client.js').default export const LayoutRouter = require('next/dist/client/components/layout-router.client.js').default
export const RenderFromTemplateContext = require('next/dist/client/components/render-from-template-context.client.js').default
export const HotReloader = ${ export const HotReloader = ${
// Disable HotReloader component in production // Disable HotReloader component in production
this.mode === 'development' this.mode === 'development'
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
import '../build/polyfills/polyfill-module' import '../build/polyfills/polyfill-module'
// @ts-ignore react-dom/client exists when using React 18 // @ts-ignore react-dom/client exists when using React 18
import ReactDOMClient from 'react-dom/client' import ReactDOMClient from 'react-dom/client'
// @ts-ignore startTransition exists when using React 18
import React from 'react' import React from 'react'
import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack' import { createFromReadableStream } from 'next/dist/compiled/react-server-dom-webpack'
...@@ -44,21 +43,6 @@ export const version = process.env.__NEXT_VERSION ...@@ -44,21 +43,6 @@ export const version = process.env.__NEXT_VERSION
const appElement: HTMLElement | Document | null = document const appElement: HTMLElement | Document | null = document
let reactRoot: any = null
function renderReactElement(
domEl: HTMLElement | Document,
fn: () => JSX.Element
): void {
const reactEl = fn()
if (!reactRoot) {
// Unlike with createRoot, you don't need a separate root.render() call here
reactRoot = (ReactDOMClient as any).hydrateRoot(domEl, reactEl)
} else {
reactRoot.render(reactEl)
}
}
const getCacheKey = () => { const getCacheKey = () => {
const { pathname, search } = location const { pathname, search } = location
return pathname + search return pathname + search
...@@ -182,11 +166,19 @@ function RSCComponent(props: any) { ...@@ -182,11 +166,19 @@ function RSCComponent(props: any) {
} }
export function hydrate() { export function hydrate() {
renderReactElement(appElement!, () => ( const reactEl = (
<React.StrictMode> <React.StrictMode>
<Root> <Root>
<RSCComponent /> <RSCComponent />
</Root> </Root>
</React.StrictMode> </React.StrictMode>
)) )
const isError = document.documentElement.id === '__next_error__'
const reactRoot = isError
? (ReactDOMClient as any).createRoot(appElement)
: (ReactDOMClient as any).hydrateRoot(appElement, reactEl)
if (isError) {
reactRoot.render(reactEl)
}
} }
...@@ -12,6 +12,7 @@ import type { ...@@ -12,6 +12,7 @@ import type {
import { import {
LayoutRouterContext, LayoutRouterContext,
GlobalLayoutRouterContext, GlobalLayoutRouterContext,
TemplateContext,
} from '../../shared/lib/app-router-context' } from '../../shared/lib/app-router-context'
import { fetchServerResponse } from './app-router.client' import { fetchServerResponse } from './app-router.client'
// import { matchSegment } from './match-segments' // import { matchSegment } from './match-segments'
...@@ -312,7 +313,7 @@ function LoadingBoundary({ ...@@ -312,7 +313,7 @@ function LoadingBoundary({
}: { }: {
children: React.ReactNode children: React.ReactNode
loading?: React.ReactNode loading?: React.ReactNode
}) { }): JSX.Element {
if (loading) { if (loading) {
return <React.Suspense fallback={loading}>{children}</React.Suspense> return <React.Suspense fallback={loading}>{children}</React.Suspense>
} }
...@@ -320,6 +321,65 @@ function LoadingBoundary({ ...@@ -320,6 +321,65 @@ function LoadingBoundary({
return <>{children}</> return <>{children}</>
} }
type ErrorComponent = React.ComponentType<{ error: Error; reset: () => void }>
interface ErrorBoundaryProps {
errorComponent: ErrorComponent
}
/**
* Handles errors through `getDerivedStateFromError`.
* Renders the provided error component and provides a way to `reset` the error boundary state.
*/
class ErrorBoundaryHandler extends React.Component<
ErrorBoundaryProps,
{ error: Error | null }
> {
constructor(props: ErrorBoundaryProps) {
super(props)
this.state = { error: null }
}
static getDerivedStateFromError(error: Error) {
return { error }
}
reset = () => {
this.setState({ error: null })
}
render() {
if (this.state.error) {
return (
<this.props.errorComponent
error={this.state.error}
reset={this.reset}
/>
)
}
return this.props.children
}
}
/**
* Renders error boundary with the provided "errorComponent" property as the fallback.
* If no "errorComponent" property is provided it renders the children without an error boundary.
*/
function ErrorBoundary({
errorComponent,
children,
}: ErrorBoundaryProps & { children: React.ReactNode }): JSX.Element {
if (errorComponent) {
return (
<ErrorBoundaryHandler errorComponent={errorComponent}>
{children}
</ErrorBoundaryHandler>
)
}
return <>{children}</>
}
/** /**
* OuterLayoutRouter handles the current segment as well as <Offscreen> rendering of other segments. * OuterLayoutRouter handles the current segment as well as <Offscreen> rendering of other segments.
* It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes. * It can be rendered next to each other with a different `parallelRouterKey`, allowing for Parallel routes.
...@@ -328,12 +388,16 @@ export default function OuterLayoutRouter({ ...@@ -328,12 +388,16 @@ export default function OuterLayoutRouter({
parallelRouterKey, parallelRouterKey,
segmentPath, segmentPath,
childProp, childProp,
error,
loading, loading,
template,
rootLayoutIncluded, rootLayoutIncluded,
}: { }: {
parallelRouterKey: string parallelRouterKey: string
segmentPath: FlightSegmentPath segmentPath: FlightSegmentPath
childProp: ChildProp childProp: ChildProp
error: ErrorComponent
template: React.ReactNode
loading: React.ReactNode | undefined loading: React.ReactNode | undefined
rootLayoutIncluded: boolean rootLayoutIncluded: boolean
}) { }) {
...@@ -371,9 +435,20 @@ export default function OuterLayoutRouter({ ...@@ -371,9 +435,20 @@ export default function OuterLayoutRouter({
<> <>
{preservedSegments.map((preservedSegment) => { {preservedSegments.map((preservedSegment) => {
return ( return (
// Loading boundary is render for each segment to ensure they have their own loading state. /*
// The loading boundary is passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch. - Error boundary
<LoadingBoundary loading={loading} key={preservedSegment}> - Only renders error boundary if error component is provided.
- Rendered for each segment to ensure they have their own error state.
- Loading boundary
- Only renders suspense boundary if loading components is provided.
- Rendered for each segment to ensure they have their own loading state.
- Passed to the router during rendering to ensure it can be immediately rendered when suspending on a Flight fetch.
*/
<TemplateContext.Provider
key={preservedSegment}
value={
<ErrorBoundary errorComponent={error}>
<LoadingBoundary loading={loading}>
<InnerLayoutRouter <InnerLayoutRouter
parallelRouterKey={parallelRouterKey} parallelRouterKey={parallelRouterKey}
url={url} url={url}
...@@ -388,6 +463,11 @@ export default function OuterLayoutRouter({ ...@@ -388,6 +463,11 @@ export default function OuterLayoutRouter({
rootLayoutIncluded={rootLayoutIncluded} rootLayoutIncluded={rootLayoutIncluded}
/> />
</LoadingBoundary> </LoadingBoundary>
</ErrorBoundary>
}
>
{template}
</TemplateContext.Provider>
) )
})} })}
</> </>
......
import React, { useContext } from 'react'
import { TemplateContext } from '../../shared/lib/app-router-context'
export default function RenderFromTemplateContext(): JSX.Element {
const children = useContext(TemplateContext)
return <>{children}</>
}
...@@ -26,6 +26,7 @@ import { ...@@ -26,6 +26,7 @@ import {
FlightManifest, FlightManifest,
} from '../build/webpack/plugins/flight-manifest-plugin' } from '../build/webpack/plugins/flight-manifest-plugin'
import { FlushEffectsContext } from '../client/components/hooks-client' import { FlushEffectsContext } from '../client/components/hooks-client'
import type { ComponentsType } from '../build/webpack/loaders/next-app-loader'
// this needs to be required lazily so that `next-server` can set // this needs to be required lazily so that `next-server` can set
// the env before we require // the env before we require
...@@ -290,12 +291,7 @@ export type Segment = ...@@ -290,12 +291,7 @@ export type Segment =
type LoaderTree = [ type LoaderTree = [
segment: string, segment: string,
parallelRoutes: { [parallelRouterKey: string]: LoaderTree }, parallelRoutes: { [parallelRouterKey: string]: LoaderTree },
components: { components: ComponentsType
filePath: string
layout?: () => any
loading?: () => any
page?: () => any
}
] ]
/** /**
...@@ -524,6 +520,8 @@ export async function renderToHTMLOrFlight( ...@@ -524,6 +520,8 @@ export async function renderToHTMLOrFlight(
const pageIsDynamic = isDynamicRoute(pathname) const pageIsDynamic = isDynamicRoute(pathname)
const LayoutRouter = const LayoutRouter =
ComponentMod.LayoutRouter as typeof import('../client/components/layout-router.client').default ComponentMod.LayoutRouter as typeof import('../client/components/layout-router.client').default
const RenderFromTemplateContext =
ComponentMod.RenderFromTemplateContext as typeof import('../client/components/render-from-template-context.client').default
const HotReloader = ComponentMod.HotReloader as const HotReloader = ComponentMod.HotReloader as
| typeof import('../client/components/hot-reloader.client').default | typeof import('../client/components/hot-reloader.client').default
| null | null
...@@ -654,7 +652,11 @@ export async function renderToHTMLOrFlight( ...@@ -654,7 +652,11 @@ export async function renderToHTMLOrFlight(
*/ */
const createComponentTree = async ({ const createComponentTree = async ({
createSegmentPath, createSegmentPath,
loaderTree: [segment, parallelRoutes, { filePath, layout, loading, page }], loaderTree: [
segment,
parallelRoutes,
{ layoutOrPagePath, layout, template, error, loading, page },
],
parentParams, parentParams,
firstItem, firstItem,
rootLayoutIncluded, rootLayoutIncluded,
...@@ -666,11 +668,17 @@ export async function renderToHTMLOrFlight( ...@@ -666,11 +668,17 @@ export async function renderToHTMLOrFlight(
firstItem?: boolean firstItem?: boolean
}): Promise<{ Component: React.ComponentType }> => { }): Promise<{ Component: React.ComponentType }> => {
// TODO-APP: enable stylesheet per layout/page // TODO-APP: enable stylesheet per layout/page
const stylesheets = getCssInlinedLinkTags( const stylesheets: string[] = layoutOrPagePath
? getCssInlinedLinkTags(
serverComponentManifest, serverComponentManifest,
serverCSSManifest!, serverCSSManifest!,
filePath layoutOrPagePath
) )
: []
const Template = template
? await interopDefault(template())
: React.Fragment
const ErrorComponent = error ? await interopDefault(error()) : undefined
const Loading = loading ? await interopDefault(loading()) : undefined const Loading = loading ? await interopDefault(loading()) : undefined
const isLayout = typeof layout !== 'undefined' const isLayout = typeof layout !== 'undefined'
const isPage = typeof page !== 'undefined' const isPage = typeof page !== 'undefined'
...@@ -746,6 +754,12 @@ export async function renderToHTMLOrFlight( ...@@ -746,6 +754,12 @@ export async function renderToHTMLOrFlight(
parallelRouterKey={parallelRouteKey} parallelRouterKey={parallelRouteKey}
segmentPath={createSegmentPath(currentSegmentPath)} segmentPath={createSegmentPath(currentSegmentPath)}
loading={Loading ? <Loading /> : undefined} loading={Loading ? <Loading /> : undefined}
error={ErrorComponent}
template={
<Template>
<RenderFromTemplateContext />
</Template>
}
childProp={childProp} childProp={childProp}
rootLayoutIncluded={rootLayoutIncludedAtThisLevelOrAbove} rootLayoutIncluded={rootLayoutIncludedAtThisLevelOrAbove}
/>, />,
...@@ -769,13 +783,21 @@ export async function renderToHTMLOrFlight( ...@@ -769,13 +783,21 @@ export async function renderToHTMLOrFlight(
: childSegment, : childSegment,
} }
const segmentPath = createSegmentPath(currentSegmentPath)
// This is turned back into an object below. // This is turned back into an object below.
return [ return [
parallelRouteKey, parallelRouteKey,
<LayoutRouter <LayoutRouter
parallelRouterKey={parallelRouteKey} parallelRouterKey={parallelRouteKey}
segmentPath={createSegmentPath(currentSegmentPath)} segmentPath={segmentPath}
error={ErrorComponent}
loading={Loading ? <Loading /> : undefined} loading={Loading ? <Loading /> : undefined}
template={
<Template>
<RenderFromTemplateContext />
</Template>
}
childProp={childProp} childProp={childProp}
rootLayoutIncluded={rootLayoutIncludedAtThisLevelOrAbove} rootLayoutIncluded={rootLayoutIncludedAtThisLevelOrAbove}
/>, />,
...@@ -1142,6 +1164,7 @@ export async function renderToHTMLOrFlight( ...@@ -1142,6 +1164,7 @@ export async function renderToHTMLOrFlight(
return flushed return flushed
} }
try {
const renderStream = await renderToInitialStream({ const renderStream = await renderToInitialStream({
ReactDOMServer, ReactDOMServer,
element: content, element: content,
...@@ -1165,6 +1188,37 @@ export async function renderToHTMLOrFlight( ...@@ -1165,6 +1188,37 @@ export async function renderToHTMLOrFlight(
flushEffectHandler, flushEffectHandler,
flushEffectsToHead: true, flushEffectsToHead: true,
}) })
} catch (err) {
// TODO-APP: show error overlay in development. `element` should probably be wrapped in AppRouter for this case.
const renderStream = await renderToInitialStream({
ReactDOMServer,
element: (
<html id="__next_error__">
<head></head>
<body></body>
</html>
),
streamOptions: {
nonce,
// Include hydration scripts in the HTML
bootstrapScripts: subresourceIntegrityManifest
? buildManifest.rootMainFiles.map((src) => ({
src: `${renderOpts.assetPrefix || ''}/_next/` + src,
integrity: subresourceIntegrityManifest[src],
}))
: buildManifest.rootMainFiles.map(
(src) => `${renderOpts.assetPrefix || ''}/_next/` + src
),
},
})
return await continueFromInitialStream(renderStream, {
dataStream: serverComponentsInlinedTransformStream?.readable,
generateStaticHTML: generateStaticHTML,
flushEffectHandler,
flushEffectsToHead: true,
})
}
} }
return new RenderResult(await bodyResult()) return new RenderResult(await bodyResult())
......
...@@ -66,8 +66,11 @@ export const GlobalLayoutRouterContext = React.createContext<{ ...@@ -66,8 +66,11 @@ export const GlobalLayoutRouterContext = React.createContext<{
focusAndScrollRef: FocusAndScrollRef focusAndScrollRef: FocusAndScrollRef
}>(null as any) }>(null as any)
export const TemplateContext = React.createContext<React.ReactNode>(null as any)
if (process.env.NODE_ENV !== 'production') { if (process.env.NODE_ENV !== 'production') {
AppRouterContext.displayName = 'AppRouterContext' AppRouterContext.displayName = 'AppRouterContext'
LayoutRouterContext.displayName = 'LayoutRouterContext' LayoutRouterContext.displayName = 'LayoutRouterContext'
GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext' GlobalLayoutRouterContext.displayName = 'GlobalLayoutRouterContext'
TemplateContext.displayName = 'TemplateContext'
} }
type ValueOf<T> = Required<T>[keyof T] export type ValueOf<T> = Required<T>[keyof T]
export const COMPILER_NAMES = { export const COMPILER_NAMES = {
client: 'client', client: 'client',
......
export default function ErrorBoundary({ error, reset }) {
return (
<>
<p id="error-boundary-message">An error occurred: {error.message}</p>
<button id="reset" onClick={() => reset()}>
Try again
</button>
</>
)
}
import { useState } from 'react'
export default function Page() {
const [clicked, setClicked] = useState(false)
if (clicked) {
throw new Error('this is a test')
}
return (
<button
id="error-trigger-button"
onClick={() => {
setClicked(true)
}}
>
Trigger Error!
</button>
)
}
export default function Page() {
throw new Error('Error during SSR')
}
import Link from 'next/link'
export default function Page() {
return (
<>
<p id="other-page">Other Page</p>
<Link href="/template/clientcomponent">
<a id="link">To Page</a>
</Link>
</>
)
}
import Link from 'next/link'
export default function Page() {
return (
<>
<p id="page">Page</p>
<Link href="/template/clientcomponent/other">
<a id="link">To Other</a>
</Link>
</>
)
}
import { useState } from 'react'
export default function Template({ children }) {
const [count, setCount] = useState(0)
return (
<>
<h1>Template {count}</h1>
<button onClick={() => setCount(count + 1)}>Increment</button>
{children}
</>
)
}
import Link from 'next/link'
export default function Page() {
return (
<>
<p id="other-page">Other Page</p>
<Link href="/template/servercomponent">
<a id="link">To Page</a>
</Link>
</>
)
}
import Link from 'next/link'
export default function Page() {
return (
<>
<p id="page">Page</p>
<Link href="/template/servercomponent/other">
<a id="link">To Other</a>
</Link>
</>
)
}
export default function Template({ children }) {
return (
<>
<h1>
Template <span id="performance-now">{performance.now()}</span>
</h1>
{children}
</>
)
}
...@@ -1317,6 +1317,106 @@ describe('app dir', () => { ...@@ -1317,6 +1317,106 @@ describe('app dir', () => {
expect(res.status).toBe(500) expect(res.status).toBe(500)
}) })
}) })
describe('template component', () => {
it('should render the template that holds state in a client component and reset on navigation', async () => {
const browser = await webdriver(next.url, '/template/clientcomponent')
expect(await browser.elementByCss('h1').text()).toBe('Template 0')
await browser.elementByCss('button').click()
expect(await browser.elementByCss('h1').text()).toBe('Template 1')
await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#other-page')
expect(await browser.elementByCss('h1').text()).toBe('Template 0')
await browser.elementByCss('button').click()
expect(await browser.elementByCss('h1').text()).toBe('Template 1')
await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#page')
expect(await browser.elementByCss('h1').text()).toBe('Template 0')
})
it('should render the template that is a server component and rerender on navigation', async () => {
const browser = await webdriver(next.url, '/template/servercomponent')
expect(await browser.elementByCss('h1').text()).toStartWith('Template')
const currentTime = await browser
.elementByCss('#performance-now')
.text()
await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#other-page')
expect(await browser.elementByCss('h1').text()).toStartWith('Template')
// template should rerender on navigation even when it's a server component
expect(await browser.elementByCss('#performance-now').text()).toBe(
currentTime
)
await browser.elementByCss('#link').click()
await browser.waitForElementByCss('#page')
expect(await browser.elementByCss('#performance-now').text()).toBe(
currentTime
)
})
})
// TODO-APP: This is disabled for development as the error overlay needs to be reworked.
;(isDev ? describe.skip : describe)('error component', () => {
it('should trigger error component when an error happens during rendering', async () => {
const browser = await webdriver(next.url, '/error/clientcomponent')
await browser
.elementByCss('#error-trigger-button')
.click()
.waitForElementByCss('#error-boundary-message')
expect(
await browser.elementByCss('#error-boundary-message').text()
).toBe('An error occurred: this is a test')
})
it('should allow resetting error boundary', async () => {
const browser = await webdriver(next.url, '/error/clientcomponent')
// Try triggering and resetting a few times in a row
for (let i = 0; i < 5; i++) {
await browser
.elementByCss('#error-trigger-button')
.click()
.waitForElementByCss('#error-boundary-message')
expect(
await browser.elementByCss('#error-boundary-message').text()
).toBe('An error occurred: this is a test')
await browser
.elementByCss('#reset')
.click()
.waitForElementByCss('#error-trigger-button')
expect(
await browser.elementByCss('#error-trigger-button').text()
).toBe('Trigger Error!')
}
})
it('should hydrate empty shell to handle server-side rendering errors', async () => {
const browser = await webdriver(
next.url,
'/error/ssr-error-client-component'
)
const logs = await browser.log()
const errors = logs
.filter((x) => x.source === 'error')
.map((x) => x.message)
.join('\n')
expect(errors).toInclude('Error during SSR')
})
})
} }
describe('without assetPrefix', () => { describe('without assetPrefix', () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment