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

All api requests return 404 not found -- can't troubleshoot #1554

Open
uluhonolulu opened this issue Sep 30, 2024 · 0 comments
Open

All api requests return 404 not found -- can't troubleshoot #1554

uluhonolulu opened this issue Sep 30, 2024 · 0 comments

Comments

@uluhonolulu
Copy link

Describe the bug

I use NodeJS v4 API functions. If there is an error on the root level of any function (or imported) file, no HTTP handlers are registered, therefore, every request returns 404 Not Found.

However, it is impossible to troubleshoot such errors because they don't show up in the deployment log.

To Reproduce
Add the following code to the top of an API function file, before app.http(...):

const OpenAI = require('openai');
const openai = new OpenAI({apiKey: process.env.OPENAI_API_KEY});

if OPENAI_API_KEY is not set in your environment, the function will throw an error and other handlers will not be registered. However, the build log will say that the build was successful.

Expected behavior
I expect the build to fail and the build log to contain the description of the error.

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

No branches or pull requests

1 participant