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

[🐞] from create qwik latest, I can't make cloudflare-pages work since 1.2.14 #5400

Closed
tidiview opened this issue Nov 4, 2023 · 15 comments
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@tidiview
Copy link
Contributor

tidiview commented Nov 4, 2023

Which component is affected?

Qwik Runtime

Describe the bug

I am using Windows, Visual Code, from there create qwik latest, pnpm install, then cloudflare-pages adapter, pnpm build, then start. In local, no problem but when transfer to github repo, the cloudflare building do not work at all.
The site builds on cloudflare, but once it has build, the site appears completely blank since 1.2.15, then 1.2.16 and now, 1.2.17.
I thought that other user would report it and that it would be solved, but it seemed that I am the only one to have that problem therefore may be I have a specific problem, so I decided to put it here.

Reproduction

https://66751608.worktop-qwikcity.pages.dev/

Steps to reproduce

pnpm create latest, pnpm install, then cloudflare-pages adapter, pnpm build, then start.

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (4) x64 Intel(R) Core(TM) i3-4160 CPU @ 3.60GHz
    Memory: 1.75 GB / 7.86 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.19 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
    pnpm: 8.8.0 - ~\AppData\Local\pnpm\pnpm.EXE
  Browsers:
    Edge: Spartan (44.19041.3570.0), Chromium (119.0.2151.44)
    Internet Explorer: 11.0.19041.3570
  npmPackages:
    @builder.io/qwik: ^1.2.17 => 1.2.17
    @builder.io/qwik-city: ^1.2.17 => 1.2.17
    undici: ^5.26.0 => 5.27.2
    vite: ^4.4.11 => 4.5.0

Additional Information

No response

@tidiview tidiview added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels Nov 4, 2023
@gioboa
Copy link
Member

gioboa commented Nov 4, 2023

I bumped up Qwik to 1.2.16 in one project and I had the same problem.
@tidiview Can you bisect the commits to figure out the problematic commit please?
Here is the guide

fun fact, the Qwik docs site is on Cloudflare and it's working 🤔

@tidiview
Copy link
Contributor Author

tidiview commented Nov 5, 2023

I don't understand the differences between qwik, qwik-city, qwik-labs in that case.
I don't have qwik-lab in my project.
So I think you are talking of qwik and qwik-city but...

@gioboa
Copy link
Member

gioboa commented Nov 7, 2023

I deployed one of my "failing with blank page project" with e CloudFlare CLI and it's working fine. 🤔

- build
- cd dist
- CLOUDFLARE_ACCOUNT_ID=XXX npx wrangler pages deploy .

@tidiview Can you test these steps too pls?

@tidiview
Copy link
Contributor Author

@gioboa I tried the previous method, but unfortunately got the same result. I reverted to 1.2.14.
For information, I tried to bisect, but couldn't figure out how to.
After several unsuccessful tries...

@tidiview
Copy link
Contributor Author

@gioboa I tried a new project from scratch, just adding cloudflare-pages. Then created a github repo. Then created a new application from the cloudflare dashboard as usual.
At the end, there is non site at all.

@tidiview
Copy link
Contributor Author

@gioboa I finally tried a new project from scratch, just adding cloudflare-pages. Then did your method: build, cd dist, then wrangler login, then npx wrangler pages deploy .
Then, it worked!
I still don't understand why the github repo method I used do not worked, but it worked.

@tidiview
Copy link
Contributor Author

@gioboa sorry to bother you multiple times but OK, I think I have a clue now.
I tried pnpm wrangler pages deploy .
I got 118 files uploaded instead of 47 with yours.
Then I had the same problem.
I resumed npx wrangler pages deploy . then it worked again.
Can't explain anything but I think that a clue for solving it.

@tidiview
Copy link
Contributor Author

@gioboa For the existing repo, I tried both methods [npx wrangler pages deploy . or commit thrue github] but couldn't get it work either way.

@gioboa
Copy link
Member

gioboa commented Nov 18, 2023

Can you try to deploy another Cloudflare site with the same codebase please?

@tidiview
Copy link
Contributor Author

tidiview commented Nov 19, 2023

I'm afraid I don't understand.
I already deployed another Cloudflare site with 1.2.18 from scratch.
It worked with npx wrangler pages deploy . I got 47 files uploaded and it worked.
With the github repo method, I have 117 files upload instead of 47, and it do not work.
So I think I already did what you are asking me to do.
If not, precise what you think please.

@gioboa
Copy link
Member

gioboa commented Nov 29, 2023

This PR #5352 generated the problem. I'm going to revert it

@gioboa
Copy link
Member

gioboa commented Nov 29, 2023

Closed by #5502

@mpeg
Copy link
Contributor

mpeg commented Nov 30, 2023

hey both, just saw this, very bizarre that it would only fail on the cloud builds, I have been unable to reproduce this – the builds work fine for me no matter where

Any chance I could get the full build logs from one of the blank page builds? As well as the list of files uploaded, please, these are both available in the deployments section of Cloudflare Pages if you click "View details" on a specific deployment

@mpeg
Copy link
Contributor

mpeg commented Nov 30, 2023

I figured out the issue, when removing the polyfill I completely forgot that Cloudflare will not update the runtime APIs on older projects by default, and keeps configurable backwards compatibility. This means that any project created before November 2022 that hasn't been updated to a later compatibility_date will not have the native stream API by default, while new projects do

Huge oversight on my part, and I apologise for any headaches it caused! You can check your compatibility_date setting in the "Settings" -> "Functions" page on the Cloudflare Pages project dashboard

I think the right way forward is probably to only remove the polyfill if it doesn't exist, that way we use the native API in new projects and projects that want to use the newer features, while keeping backwards compatibility with older ones

@tidiview
Copy link
Contributor Author

tidiview commented Dec 2, 2023

@mpeg
What would you like to know precisely?
to precise, I use to:

  • have a repo on github, first, upgade to new version. Problem from 1.2.14;
  • after upgrade, I would do pnpm build;
  • the pnpm start, checking it is working locally. 117 files changed by build command.
  • then commit to main on github repo. The commit is just package.json file.
  • automatically, Cloudflare trigger an update from the update of the github repo.
  • automated build from the new package.json file on Clouflare's server is working well.
  • but, when trying new site made out of that build, nothing appears: site is blank.
    For the 47 files changed method, @gioboa suggested it: from scratch it is working but from the existing project being upgraded, It doesn't.
    Hope this help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants