Skip to content

Commit 0520203

Browse files
adriandlampranaygp
andcommitted
fix: normalize workbench tests (#292)
* Proper stacktrace propogation in world Proper stacktrace propogation in world * Standardize the error type in the world spec * Normalize Workbenches Normalize trigger scripts across workbenches fix: include hono in local build test test: include src dir for test test: add workflow dir config in test to fix sveltekit dev tests add temp 7_full in example wokrflow format fix(sveltekit): detecting workflow folders and customizable dir Remove 7_full and 1_simple error replace API symlink in webpack workbench Fix sveltekit and vite tests Fix sveltekit symlinks Test fixes Fix sveltekit workflows path Dont symlink routes in vite Include e2e tests for hono and vite * fix error tests post normalization * fix(sveltekit): reading file on hmr delete * changeset * fix(vite): add resolve symlink script * fix(vite): missing building on hmr * test local builder in vite * test: increase timeout on hookWorkflow * test: ignore vite based apps in crossFileWorkflow * test: fix nitro based apps status codes * fix: intercept default vite spa handler on 404 workflow routes * fix: vite hook route returning 422 * test: use 422 for hookWorkflow expected * test: fix hono returning 404 * chore: add comment to middleware to clarify * make api route for duplicate case * revert * revert: nitro builder * add back nitro unhandled rejection logic * test: add hono * changeset * fix: unused method * fix: remove duplicate import * remove * chore: add comments to clarify * test remove vite symlink script --------- Co-authored-by: Pranay Prakash <[email protected]>
1 parent 0ee12d9 commit 0520203

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/nitro/src/builders.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,15 @@ export class LocalBuilder extends BaseBuilder {
7070
bundle: false,
7171
suppressUndefinedRejections: true,
7272
});
73+
74+
// Post-process the generated file to wrap with SvelteKit request converter
75+
let webhookRouteContent = await readFile(webhookRouteFile, 'utf-8');
76+
77+
// NOTE: This is a workaround to avoid crashing in local dev when context isn't set for waitUntil()
78+
webhookRouteContent = `process.on('unhandledRejection', (reason) => { if (reason !== undefined) console.error('Unhandled rejection detected', reason); });
79+
${webhookRouteContent}`;
80+
81+
await writeFile(webhookRouteFile, webhookRouteContent);
7382
}
7483
}
7584

0 commit comments

Comments
 (0)