Skip to content

Fix proxy server: remove URL param so it doesn't interfere with Next.js #753

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

Merged
merged 2 commits into from
Jul 31, 2025

Conversation

wwwillchen
Copy link
Contributor

@wwwillchen wwwillchen commented Jul 31, 2025

Fixes #748

Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cubic analysis

1 issue found across 2 files • Review in cubic

React with 👍 or 👎 to teach cubic. You can also tag @cubic-dev-ai to give feedback, ask questions, or re-run the review.

/* ──────────────────────────── worker code ─────────────────────────────── */

const LISTEN_PORT = process.env.LISTEN_PORT || workerData.port;
const LISTEN_PORT = workerData.port;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropping the environment-variable fallback makes LISTEN_PORT undefined when workerData.port is not present, leading to a TypeError in server.listen.

Prompt for AI agents
Address the following comment on worker/proxy_server.js at line 16:

<comment>Dropping the environment-variable fallback makes LISTEN_PORT undefined when workerData.port is not present, leading to a TypeError in server.listen.</comment>

<file context>
@@ -16,33 +11,14 @@ const { URL } = require(&quot;url&quot;);
 const fs = require(&quot;fs&quot;);
 const path = require(&quot;path&quot;);
 
-/* ─────────────────── configuration (main thread only) ─────────────────── */
-
-const LISTEN_HOST = &quot;localhost&quot;;
-
-if (isMainThread) {
-  // Stand-alone mode: fork the worker and pass through the env as-is
</file context>

@wwwillchen wwwillchen merged commit 03c200b into main Jul 31, 2025
4 of 5 checks passed
@wwwillchen wwwillchen deleted the next-opt-image branch July 31, 2025 22:18
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

Successfully merging this pull request may close these issues.

Issue with images in Next.js when not using unoptimized
1 participant