File tree 3 files changed +9
-4
lines changed
packages/next-on-pages/templates/_worker.js/utils
3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ ' @cloudflare/next-on-pages ' : patch
3
+ ---
4
+
5
+ chore: Extract module name in dynamic imports
Original file line number Diff line number Diff line change @@ -117,7 +117,8 @@ export async function getSuspenseCacheAdaptor(): Promise<CacheAdaptor> {
117
117
async function getInternalCacheAdaptor (
118
118
type : 'kv' | 'cache-api' ,
119
119
) : Promise < CacheAdaptor > {
120
- const adaptor = await import ( `./__next-on-pages-dist__/cache/${ type } .js` ) ;
120
+ const moduleName = `./__next-on-pages-dist__/cache/${ type } .js` ;
121
+ const adaptor = await import ( moduleName ) ;
121
122
return new adaptor . default ( ) ;
122
123
}
123
124
Original file line number Diff line number Diff line change @@ -49,9 +49,8 @@ async function handleInlineAssetRequest(request: Request) {
49
49
if ( request . url . startsWith ( 'blob:' ) ) {
50
50
try {
51
51
const url = new URL ( request . url ) ;
52
- const binaryContent = (
53
- await import ( `./__next-on-pages-dist__/assets/${ url . pathname } .bin` )
54
- ) . default ;
52
+ const moduleName = `./__next-on-pages-dist__/assets/${ url . pathname } .bin` ;
53
+ const binaryContent = ( await import ( moduleName ) ) . default ;
55
54
56
55
// Note: we can't generate a real Response object here because this fetch might be called
57
56
// at the top level of a dynamically imported module, and such cases produce the following
You can’t perform that action at this time.
0 commit comments