File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/runtime/src/templates/edge Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ const exists = async (relativePath) => {
19
19
throw error
20
20
}
21
21
}
22
+ let idx = 0
22
23
23
24
const handler = async ( req , context ) => {
24
25
// Uncomment when CLI update lands
@@ -34,8 +35,9 @@ const handler = async (req, context) => {
34
35
// because that would also throw if there's an error in the middleware,
35
36
// which we would want to surface not ignore.
36
37
if ( await exists ( '../../middleware.js' ) ) {
37
- // These will be user code
38
- const nextMiddleware = await import ( '../../middleware.js' )
38
+ // We need to cache-bust the import because otherwise it will claim it
39
+ // doesn't exist if the user creates it after the server starts
40
+ const nextMiddleware = await import ( `../../middleware.js#${ idx ++ } ` )
39
41
middleware = nextMiddleware . middleware
40
42
} else {
41
43
// No middleware, so we silently return
You can’t perform that action at this time.
0 commit comments