Repository navigation
Fix server startup on Windows - #342
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_016Wuh9RTwTUHB7wxpNxrSiw
✅ Deploy Preview for web-check ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
lissy93
approved these changes
Sep 14, 2026
lissy93
left a comment
Owner
There was a problem hiding this comment.
LGTM, I'll push the update on the last occourance which still needs updating on line 214
| app.use(express.static('dist/client/')); | ||
| app.use(async (req, res, next) => { | ||
| const ssrHandlerPath = path.join(__dirname, 'dist', 'server', 'entry.mjs'); | ||
| import(ssrHandlerPath) |
Owner
There was a problem hiding this comment.
I think this needs updating too, like
import(pathToFileURL(ssrHandlerPath).href)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Running the self-hosted server with
node server(yarn start) fails on Windows for two reasons:__filenameis computed withnew URL(import.meta.url).pathname, which gives/C:/Users/.../server.json Windows. The server then readsC:\C:\Users\...\package.jsonand stops at startup:pathnameis also percent-encoded, so a checkout path containing spaces breaks the same way on macOS and Linux.fileURLToPath(import.meta.url)handles both.With that fixed, every API handler fails to load, because it is imported with
import(path.join(dirPath, dirent.name)). On Windows an absolute path is not a valid ESM specifier:The routes are never registered, so
/api/*returns 404. The path is now converted withpathToFileURL(...).href.Tested on Windows 11 / Node 24.14.0 with
node server.js:GET /api/dns?url=example.comreturns 404 and the log shows theERR_UNSUPPORTED_ESM_URL_SCHEMErejections (2).GET /api/dns?url=example.comreturns 200 with the handler's JSON response.I did not test on macOS or Linux, but both functions are standard Node APIs and behave the same there for paths without special characters.
🤖 Generated with Claude Code
https://claude.ai/code/session_016Wuh9RTwTUHB7wxpNxrSiw