You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TypeError [Error]: fetch failed
at node:internal/deps/undici/undici:12618:11
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async getContentAsData (file:///Users/owenbuckley/Workspace/project-evergreen/www.greenwoodjs.dev/node_modules/@greenwood/cli/src/data/client.js:9:7)
at async getContentByCollection (file:///Users/owenbuckley/Workspace/project-evergreen/www.greenwoodjs.dev/node_modules/@greenwood/cli/src/data/client.js:18:10)
at async Header.connectedCallback (file:///Users/owenbuckley/Workspace/project-evergreen/www.greenwoodjs.dev/src/components/header/header.js:12:23)
at async initializeCustomElement (file:///Users/owenbuckley/Workspace/project-evergreen/www.greenwoodjs.dev/node_modules/wc-compiler/src/wcc.js:233:5)
at async renderComponentRoots (file:///Users/owenbuckley/Workspace/project-evergreen/www.greenwoodjs.dev/node_modules/wc-compiler/src/wcc.js:54:33)
at async renderComponentRoots (file:///Users/owenbuckley/Workspace/project-evergreen/www.greenwoodjs.dev/node_modules/wc-compiler/src/wcc.js:78:7)
at async renderComponentRoots (file:///Users/owenbuckley/Workspace/project-evergreen/www.greenwoodjs.dev/node_modules/wc-compiler/src/wcc.js:78:7)
at async renderFromHTML (file:///Users/owenbuckley/Workspace/project-evergreen/www.greenwoodjs.dev/node_modules/wc-compiler/src/wcc.js:278:21) {
cause: Error: connect ECONNREFUSED ::1:1984
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
errno: -61,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '::1',
port: 1984
}
}
Details
This is because In the current implementation of our data client, we hardcode a fallback port in the client for communicating with the content (dev) server
thescientist13
changed the title
content as data breaks when prerendering with a custom dev server port
content as data client breaks when prerendering with a custom dev server port
Dec 1, 2024
Type of Change
Bug
Summary
If you change the dev server port and run a build with
prerender: true
, e.g.You will get an error running
greenwood build
Details
This is because In the current implementation of our data client, we hardcode a fallback port in the client for communicating with the content (dev) server
And since this is client side running code, it assumes that there will be a
<script>
tag embedded on the page with the valuewindow.__CONTENT_SERVER__.PORT
https://github.com/ProjectEvergreen/greenwood/blob/v0.30.2/packages/cli/src/plugins/resource/plugin-active-content.js#L79
So seems we have to figure out a way to inject this into Node's
globalThis
scope as well (or find another solution 😅 )The text was updated successfully, but these errors were encountered: