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

refactor(deploy): cloudflare serve #879

Merged
merged 12 commits into from
Sep 19, 2024
Merged

refactor(deploy): cloudflare serve #879

merged 12 commits into from
Sep 19, 2024

Conversation

dai-shi
Copy link
Owner

@dai-shi dai-shi commented Sep 15, 2024

Copy link

vercel bot commented Sep 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Sep 19, 2024 3:13am

Copy link

codesandbox-ci bot commented Sep 15, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@@ -132,7 +138,7 @@ export function deployCloudflarePlugin(opts: {
writeFileSync(
workerEntrypoint,
Copy link
Owner Author

Choose a reason for hiding this comment

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

I wonder if index.js and serve-cloudflare.js can be combined.

Copy link
Contributor

Choose a reason for hiding this comment

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

It could be. We could remove this and update SERVE_JS to const SERVE_JS = 'index.js';

@dai-shi dai-shi changed the title refactor(build): netlify serve refactor(build): cloudflare serve Sep 15, 2024
@dai-shi dai-shi changed the title refactor(build): cloudflare serve refactor(deploy): cloudflare serve Sep 15, 2024
@dai-shi dai-shi mentioned this pull request Sep 16, 2024
90 tasks
@rmarscher
Copy link
Contributor

We need to look into error with dynamic pages:

Cannot process SSR Error: No such module "node:fs/promises".
    at null.<anonymous> (file:///waku-project/.wrangler/tmp/pages-cwgrLE/entries.js:487:11)
    at configure (file:///waku-project/.wrangler/tmp/pages-cwgrLE/entries.js:364:15)
    at async.unstable_setShouldSkip.unstable_setShouldSkip [as unstable_setShouldSkip] (file:///waku-project/.wrangler/tmp/pages-cwgrLE/entries.js:374:11)
    at getMyPathConfig (file:///waku-project/.wrangler/tmp/pages-cwgrLE/entries.js:60:43)
    at existsPath (file:///waku-project/.wrangler/tmp/pages-cwgrLE/entries.js:76:30)
    at getSsrConfig2 (file:///waku-project/.wrangler/tmp/pages-cwgrLE/entries.js:187:30)
    at getSsrConfig (file:///waku-project/.wrangler/tmp/pages-cwgrLE/assets/rsc-renderer-GEwfLmqz.js:246:27)
    at async renderHtml (file:///waku-project/.wrangler/tmp/pages-cwgrLE/assets/ssr-BHLmp2Xr.js:197:21)
    at async Array.<anonymous> (file:///waku-project/.wrangler/tmp/pages-cwgrLE/assets/ssr-BHLmp2Xr.js:290:26)
    at async run (file:///waku-project/.wrangler/tmp/pages-cwgrLE/serve-cloudflare.js:54:7)
    ```

Copy link
Contributor

@rmarscher rmarscher left a comment

Choose a reason for hiding this comment

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

I found the fs issue exists in main. Possibly introduced in #876. So it is not this PR which looks good to me.

@dai-shi
Copy link
Owner Author

dai-shi commented Sep 17, 2024

Thanks for confirming.
Can you confirm if v0.21.2 has no issues? If so, #876 is suspicious.

@rmarscher
Copy link
Contributor

I'm a bit confused at the moment. It seems to be the same issue that was fixed in #874. I will report back when I have a better reproduction at a specific commit.

This (along with the previous #874) resolves the issue in #871. The
build config was being written to the wrong location for cloudflare
pages This PR exports a function from the build module that appends the
build config to the given entries file location. It uses a new unstable
build config state variable (`unstable_buildConfigSave`) to track
whether or not the build config has be saved to the entries file. This
allows the cloudflare deploy plugin to write the build config into the
worker function directory instead of the root.

We could merge #879 and then I can edit the base branch to main and
continue with this PR. Or however you want to handle it. Thank you!
@dai-shi dai-shi merged commit 543da2a into main Sep 19, 2024
28 checks passed
@dai-shi dai-shi deleted the refactor/deploy/cloudflare branch September 19, 2024 03:46
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.

2 participants