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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[馃悶] Qwik server$ throws 500 error [Firebase deployment] #6322

Open
rafalfigura opened this issue May 15, 2024 · 6 comments
Open

[馃悶] Qwik server$ throws 500 error [Firebase deployment] #6322

rafalfigura opened this issue May 15, 2024 · 6 comments
Labels
STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working

Comments

@rafalfigura
Copy link
Contributor

Which component is affected?

Qwik Runtime

Describe the bug

I'm trying to use server$. It looks like the deserializer (

return qwikSerializer._deserializeData(await request.text());
) gets from request.text() an empty string ''. Which then translates to an error. From the request side it looks like the json has valid data {"_entry":"3","objs":["\u0002#s_vZ1JDpk0Fwo","tool","pexels-jang-鈥榮-:fallen_leaf:-2664216.jpg",["0","1","2"]]} for some reason it doesn't work.

Example code:

 //server side
  export const getSignedImageUrl = server$(async function (imageSubject: ImageSubject, imageName: string) {
    // never triggers
  });

  //executed on the client side
    const onDrop = $(async (event: Event) => {
        const files = (event.target as HTMLInputElement).files;
        for (const file of files) {
           const { filePath, url } = await uploadFile(ImageSubject.Tool, file);
        ...
    }

export async function uploadFile(subject: ImageSubject, file: File) {
    console.log(`uploading file: ${file.name}`) // triggers
    const resp= await getSignedImageUrl(ImageSubject.Tool, file.name); // returns undefined due to the error 500 
}

Reproduction

https://github.com/rafalfigura/qwik-cloud-functions-test

Steps to reproduce

To reproduce:

  1. Deploy to firebase
  2. Click the only one button
  3. Look in the network tab for 500 error from server$ function

Firebase log with error:
image

Example working locally
image

System Info

Locally everything works as expected. When deployed to firebase with `pnpm build, firebase deploy` it throws an error.

Additional Information

More info here:
https://discord.com/channels/842438759945601056/1237142526654414919

@rafalfigura rafalfigura added STATUS-1: needs triage New issue which needs to be triaged TYPE: bug Something isn't working labels May 15, 2024
@PatrickJS
Copy link
Member

what is ImageSubject?

@rafalfigura
Copy link
Contributor Author

@PatrickJS the ImageSubject is just an Enum with strings. You can take a look here: https://github.com/rafalfigura/qwik-cloud-functions-test/blob/main/src/server/types.ts
I've checked and it doesn't work even when the server$ function is empty

@JerryWu1234
Copy link
Contributor

let me try this Bug

@PatrickJS
Copy link
Member

thanks @JerryWu1234 馃檹 馃檶

@JerryWu1234
Copy link
Contributor

image

I deployed a lot of times and it failed. maybe my country has a limitation.
firebase/firebase-tools#6268
So that I can't handle this

@PatrickJS

@PatrickJS
Copy link
Member

ok thanks @JerryWu1234 for trying to look into this

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