Skip to content

Commit d21cc48

Browse files
committed
Revert "fix: check type before using string-only method (#2393)"
This reverts commit 06f0e0c.
1 parent 2c24116 commit d21cc48

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

.github/workflows/test-integration.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
with:
2929
deno-version: v1.x
3030
- name: Install netlify-cli and npm
31-
run: npm install -g netlify-cli npm@10.2.4
31+
run: npm install -g netlify-cli npm
3232
- name: NPM Install
3333
run: npm install
3434
- name: Run integration tests

packages/runtime/src/templates/handlerUtils.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,10 @@ export const augmentFsModule = ({
135135

136136
// ...then monkey-patch it to see if it's requesting a CDN file
137137
promises.readFile = (async (file, options) => {
138-
// file argument can be a string, URL, etc - Next.js cache reading uses a string
139-
// and that's only thing we really want to handle here, so we just do type checking
140-
// instead of trying to handle all possible type before checking weather read
141-
// is about page files.
142-
if (typeof file === 'string' && file.startsWith(pageRoot)) {
143-
const baseUrl = getBase()
138+
const baseUrl = getBase()
139+
140+
// We only care about page files
141+
if (file.startsWith(pageRoot)) {
144142
// We only want the part after `.next/server/`
145143
const filePath = file.slice(pageRoot.length + 1)
146144

0 commit comments

Comments
 (0)