Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

You stumbled upon a bug - renderPage function when migrating from version 0.4.150 to 0.4.151 #1404

Closed
gasparearmato6991 opened this issue Jan 2, 2024 · 7 comments
Labels

Comments

@gasparearmato6991
Copy link

gasparearmato6991 commented Jan 2, 2024

Description

Hello! We just stumbled on a bug upgrading Vike to version 0.4.151, it's working fine with the 0.4.150 but it's not with all the newer versions (we also tried with the latest one, the 0.4.153)

Error: [[email protected]][Bug] You stumbled upon a bug in Vike's source code. Go to https://github.com/vikejs/vike/issues/new and copy-paste this error; a maintainer will fix the bug (usually under 24 hours).
    at file:///Users/username/Desktop/org/repos/repo/node_modules/vike/dist/esm/node/runtime/globalContext/loadImportBuild.js:16:13
    at autoRetry (file:///Users/username/Desktop/org/repos/repo/node_modules/vike/dist/esm/utils/autoRetry.js:9:19)
    at async loadImportBuild (file:///Users/username/Desktop/org/repos/repo/node_modules/vike/dist/esm/node/runtime/globalContext/loadImportBuild.js:15:9)
    at async initGlobalContext (file:///Users/username/Desktop/org/repos/repo/node_modules/vike/dist/esm/node/runtime/globalContext.js:75:30)
    at async renderPageAndPrepare (file:///Users/username/Desktop/org/repos/repo/node_modules/vike/dist/esm/node/runtime/renderPage.js:66:9)
    at async renderPage_wrapper (file:///Users/username/Desktop/org/repos/repo/node_modules/vike/dist/esm/node/runtime/renderPage.js:26:24)
    at async renderPage (file:///Users/username/Desktop/org/repos/repo/node_modules/vike/dist/esm/node/runtime/renderPage.js:46:50)
    at async file:///Users/username/Desktop/org/repos/repo/dist/index.js:220:27

And our index.ts looks like that:

import express from "express";
import {renderPage} from "vike/server";

async function startServer(): Promise<void> {
    const app = express()

    app.get("*", async (req, res, next) => {

        const pageContextInit = {
            urlOriginal: req.originalUrl,
            environment: {
                CUSTOM_ENV_VAR: "VALUE",
            }
        };
        const pageContext = await renderPage(pageContextInit);
    })
}

startServer();

We are using Vike with Svelte if it can be useful.

@brillout
Copy link
Member

brillout commented Jan 2, 2024 via email

@gasparearmato6991
Copy link
Author

No, the error is appearing when we switch from 0.4.150 to 0.4.151 but even trying with a newer version (e.g. 0.4.152 or 0.4.153 it does not work)

@brillout
Copy link
Member

brillout commented Jan 2, 2024

If you increase the timeout from 2000 to 20000 at line 17 of the file /Users/username/Desktop/org/repos/repo/node_modules/vike/dist/esm/node/runtime/globalContext/loadImportBuild.js, do you get the same error or another error?

@gasparearmato6991
Copy link
Author

gasparearmato6991 commented Jan 3, 2024

Unfortunately no, it just start retrying more and more times until it reaches the 20s timeout

@brillout
Copy link
Member

brillout commented Jan 3, 2024

That's quite unexpected. I'll need a reproduction, ideally a minimal one although it doesn't have to.

@brillout
Copy link
Member

brillout commented Jan 5, 2024

Fix pre-released in 0.4.153-commit-e631897 .

@brillout
Copy link
Member

brillout commented Jan 5, 2024

Also, would your company be up for sponsoring?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants