fix: use dynamic import instead of require for browser compatibility
- Replace require() with await import() for ES module compatibility - Add async to setTimeout callback for dynamic import support
This commit is contained in:
@@ -146,8 +146,9 @@ async function initializeReader(): Promise<void> {
|
||||
// Render the initial chapter content
|
||||
await renderSpineItem();
|
||||
// Initialize page calculation for dynamic page numbers
|
||||
setTimeout(() => {
|
||||
const { initializePageCalculation } = require("./core/reader-navigation");
|
||||
setTimeout(async () => {
|
||||
const { initializePageCalculation } =
|
||||
await import("./core/reader-navigation");
|
||||
initializePageCalculation();
|
||||
}, 100);
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user