Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/fix-node-peer-dependency.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@astrojs/node': patch
---

Fixes compatibility issue with older versions of Astro by making `getAllowedDomains()` call optional and updating peer dependency to require `astro@^5.14.3`
2 changes: 1 addition & 1 deletion packages/integrations/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"server-destroy": "^1.0.1"
},
"peerDependencies": {
"astro": "^5.7.0"
"astro": "^5.14.3"
},
"devDependencies": {
"@types/node": "^22.10.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/integrations/node/src/serve-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function createAppHandler(app: NodeApp, options: Options): RequestHandler
let request: Request;
try {
request = NodeApp.createRequest(req, {
allowedDomains: app.getAllowedDomains(),
allowedDomains: app.getAllowedDomains?.() ?? [],
Copy link
Member

Choose a reason for hiding this comment

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

Are there any restrictions with this being an empty array vs it being completely missing in previous versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The option just didn't exist in previous versions, so we'd be passing an empty array that gets ignored. Seems fine?

});
} catch (err) {
logger.error(`Could not render ${req.url}`);
Expand Down
Loading