Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
feedthejim committed Oct 11, 2022
1 parent d269303 commit 2855a82
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/next/server/next-server.ts
Expand Up @@ -1765,8 +1765,9 @@ export default class NextNodeServer extends BaseServer {
}

const method = (params.request.method || 'GET').toUpperCase()
const { run } = require('./web/sandbox') as typeof import('./web/sandbox')

const result = await require('./web/sandbox').run({
const result = await run({
distDir: this.distDir,
name: middlewareInfo.name,
paths: middlewareInfo.paths,
Expand Down Expand Up @@ -2088,7 +2089,8 @@ export default class NextNodeServer extends BaseServer {
)
}

const result = await require('./web/sandbox').run({
const { run } = require('./web/sandbox') as typeof import('./web/sandbox')
const result = await run({
distDir: this.distDir,
name: edgeInfo.name,
paths: edgeInfo.paths,
Expand Down Expand Up @@ -2128,9 +2130,8 @@ export default class NextNodeServer extends BaseServer {
if (result.response.body) {
// TODO(gal): not sure that we always need to stream
const nodeResStream = (params.res as NodeNextResponse).originalResponse
const {
consumeUint8ArrayReadableStream,
} = require('next/dist/compiled/edge-runtime')
const { consumeUint8ArrayReadableStream } =
require('next/dist/compiled/edge-runtime') as typeof import('next/dist/compiled/edge-runtime')
try {
for await (const chunk of consumeUint8ArrayReadableStream(
result.response.body
Expand Down

0 comments on commit 2855a82

Please sign in to comment.