Skip to content

Commit

Permalink
add missing exports for static generation bailout (#48910)
Browse files Browse the repository at this point in the history
### What?

add missing exports from next-app-loader

### Why?

avoid crashing

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
sokra and kodiakhq[bot] authored Apr 27, 2023
1 parent b002102 commit fafecb8
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
export { default as AppRouter } from 'next/dist/client/components/app-router.js'
export { default as LayoutRouter } from 'next/dist/client/components/layout-router.js'
export { default as RenderFromTemplateContext } from 'next/dist/client/components/render-from-template-context.js'
export { default as GlobalError } from 'next/dist/client/components/error-boundary.js'
export { staticGenerationAsyncStorage } from 'next/dist/client/components/static-generation-async-storage.js'
export { requestAsyncStorage } from 'next/dist/client/components/request-async-storage.js'
import * as serverHooks from 'next/dist/client/components/hooks-server-context.js'
export { default as AppRouter } from 'next/dist/client/components/app-router'
export { default as LayoutRouter } from 'next/dist/client/components/layout-router'
export { default as RenderFromTemplateContext } from 'next/dist/client/components/render-from-template-context'
export { default as GlobalError } from 'next/dist/client/components/error-boundary'

export { staticGenerationAsyncStorage } from 'next/dist/client/components/static-generation-async-storage'

export { requestAsyncStorage } from 'next/dist/client/components/request-async-storage'
export { actionAsyncStorage } from 'next/dist/client/components/action-async-storage'

export { staticGenerationBailout } from 'next/dist/client/components/static-generation-bailout'
export { default as StaticGenerationSearchParamsBailoutProvider } from 'next/dist/client/components/static-generation-searchparams-bailout-provider'
export { createSearchParamsBailoutProxy } from 'next/dist/client/components/searchparams-bailout-proxy'

import * as serverHooks from 'next/dist/client/components/hooks-server-context'
export { serverHooks }
export { renderToReadableStream } from 'next/dist/compiled/react-server-dom-webpack/server.edge'
export {
renderToReadableStream,
decodeReply,
} from 'next/dist/compiled/react-server-dom-webpack/server.edge'
export { preloadStyle } from 'next/dist/server/app-render/rsc/preloads'
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default function RootLayout({ children }: { children: any }) {
return (
<html>
<body>{children}</body>
</html>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import Test from './test'

export const dynamic = 'force-dynamic'

export default function Page({ searchParams }) {
return (
<div>
<h1>{JSON.stringify(searchParams)}</h1>
<Test />
</div>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
'use client'

import { useEffect } from 'react'

export default function Test() {
useEffect(() => {
import('@turbo/pack-test-harness').then(() => {
it('should run', () => {})
})
return () => {}
}, [])
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
experimental: {
appDir: true,
},
}

0 comments on commit fafecb8

Please sign in to comment.