Skip to content

Commit 386ee3a

Browse files
committed
Fix pnpm build from scratch
1 parent ac6a91e commit 386ee3a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/routes/bilibili/manga-update.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { Route } from '@/types';
22
import cache from '@/utils/cache';
33
import got from '@/utils/got';
4-
import { Go } from './wasm-exec.js';
54

65
export const route: Route = {
76
path: '/manga/update/:comicid',
@@ -28,6 +27,9 @@ export const route: Route = {
2827

2928
// Based on https://github.com/SocialSisterYi/bilibili-API-collect/issues/1168#issuecomment-2620749895
3029
async function genReqSign(query, body) {
30+
// Don't import on top-level to avoid a cyclic dependency - wasm-exec.js generated via `pnpm build`, which in turn needs wasm-exec.js to import routes correctly
31+
const { Go } = await import('./wasm-exec.js');
32+
3133
// Cache the wasm binary as it's quite large (~2MB)
3234
// Here the binary is saved as base64 as the cache stores strings
3335
const wasm_buffer_base64 = await cache.tryGet('bilibili-manga-wasm-20250208', async () => {

0 commit comments

Comments
 (0)