diff --git a/packages/next/src/server/app-render/app-render.tsx b/packages/next/src/server/app-render/app-render.tsx index 93c4fadf9e4b..1494da7e5674 100644 --- a/packages/next/src/server/app-render/app-render.tsx +++ b/packages/next/src/server/app-render/app-render.tsx @@ -401,12 +401,10 @@ export async function renderToHTMLOrFlight( const createComponentAndStyles = async ({ filePath, getComponent, - shouldPreload, injectedCSS, }: { filePath: string getComponent: () => any - shouldPreload: boolean injectedCSS: Set }): Promise => { const cssHrefs = getCssInlinedLinkTags( @@ -433,11 +431,7 @@ export async function renderToHTMLOrFlight( // During HMR, it's critical to use different `precedence` values // for different stylesheets, so their order will be kept. // https://github.com/facebook/react/pull/25060 - const precedence = shouldPreload - ? process.env.NODE_ENV === 'development' - ? 'next_' + href - : 'next' - : undefined + const precedence = 'next' return ( { it('should include css imported in loading.js', async () => { - const html = await next.render('/loading-bug/hi') - // The link tag should be included together with loading - expect(html).toMatch( - /

Loading...<\/h2>/ - ) + const $ = await next.render$('/loading-bug/hi') + // The link tag should be included together with loading with "next" precedence + + expect($('link[data-precedence="next"]').length).toBe(1) + + expect($('body h2').text()).toBe('Loading...') }) it('should include css imported in client template.js', async () => {