Skip to content

Commit cb635dd

Browse files
Dieter Luypaertarunoda
authored andcommitted
use configured distDir where required (vercel#1816)
1 parent 605e739 commit cb635dd

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

server/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export default class Server {
131131
return await renderScriptError(req, res, '/_error', error, customFields, this.renderOpts)
132132
}
133133

134-
const p = join(this.dir, '.next/bundles/pages/_error.js')
134+
const p = join(this.dir, `${this.dist}/bundles/pages/_error.js`)
135135
await this.serveStatic(req, res, p)
136136
},
137137

server/render.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ async function doRender (req, res, pathname, query, {
109109

110110
export async function renderScript (req, res, page, opts) {
111111
try {
112-
const path = join(opts.dir, '.next', 'bundles', 'pages', page)
112+
const dist = getConfig(opts.dir).distDir
113+
const path = join(opts.dir, dist, 'bundles', 'pages', page)
113114
const realPath = await resolvePath(path)
114115
await serveStatic(req, res, realPath)
115116
} catch (err) {

0 commit comments

Comments
 (0)