cosmo icon indicating copy to clipboard operation
cosmo copied to clipboard

[aws-lambda-router] Playground is not displayed

Open miguelwebtales opened this issue 1 year ago • 11 comments

Component(s)

router

Component version

0.13.0

wgc version

0.55.3

controlplane version

cloud

router version

0.92.2

What happened?

When I try to enter the playground I receive this error on the browser

GET http://localhost:3003/Prod/wundergraph net::ERR_CONTENT_DECODING_FAILED 200 (OK)

The error doesn't exist if I disable the router compression routes.

	// brCompressor := middleware.NewCompressor(5, CustomCompressibleContentTypes...)
	brCompressor.SetEncoder("br", func(w io.Writer, level int) io.Writer {
		return br.NewWriterLevel(w, level)
	})
	// httpRouter.Use(brCompressor.Handler)

It seems that lambda is not being able to handle compressed responses from the router for some reason.

Environment information

No response

Router configuration

No response

Router execution config

No response

Log output

No response

Additional context

No response

miguelwebtales avatar Jul 01 '24 14:07 miguelwebtales

WunderGraph commits fully to Open Source and we want to make sure that we can help you as fast as possible. The roadmap is driven by our customers and we have to prioritize issues that are important to them. You can influence the priority by becoming a customer. Please contact us here.

github-actions[bot] avatar Jul 01 '24 14:07 github-actions[bot]

Hi @miguelwebtales, thanks for the report. We'll take a look and come back to you.

StarpTech avatar Jul 02 '24 09:07 StarpTech

@StarpTech

After a lot of hours I couldn't figure out why compression is causing this issue.

I decided to had a config env setting to disable compression to bypass this issue (I don't need compression).

I created two PR one for router #909 and another to aws-lambda-router #910

It would be nice to find why this is happening and consider this just a quick solution and extra feature for whoever needs it.

miguelwebtales avatar Jul 02 '24 11:07 miguelwebtales

Hi @miguelwebtales, we have addressed the issue in a separate PR where we disabled compression for the playground. Please test it after merge and release. I still like your proposal to make it configurable though. The place to configure this option needs to be revisited. We have plans to configure compression on the trafficShaping property on subgraph and global router level. To be frank, this is not our highest priority, so it might take a while before we work on it.

StarpTech avatar Jul 02 '24 19:07 StarpTech

Hi @StarpTech it seems it fixed partial the UX playground shows up but the same error happens when I try to make a request to the graphql endpoint "ERR_CONTENT_DECODING_FAILED"

miguelwebtales avatar Jul 16 '24 15:07 miguelwebtales

Hi @miguelwebtales could you share a reproducible example? I would like to ensure that the issue is addressed in the next release.

StarpTech avatar Jul 16 '24 15:07 StarpTech

@StarpTech it's just necessary to run aws-lambda-router latest version and make any query on the playground.

Screenshot 2024-07-17 at 12 58 29

Let me know if you can't reproduce it...

miguelwebtales avatar Jul 17 '24 12:07 miguelwebtales

Thank you, we will check it.

StarpTech avatar Jul 17 '24 13:07 StarpTech

Hi @miguelwebtales, sorry for the late response. This issue is now on our backlog and we will provide soon an update.

StarpTech avatar Sep 11 '24 15:09 StarpTech

Hi, is there any update on this issue?

ederoyd46 avatar Dec 06 '24 16:12 ederoyd46

I'm still having the same issue - I can't get playground to run due to the Accept-Encoding header being passed in by the Wundergraph customized graphiql playground. Once this is eliminated, the decoding issue resolves itself. For now I'm running a custom build of the lambda - I've added a middleware function to drop the Accept-Encoding header around the lambda http handler.

thebuck25 avatar Apr 15 '25 21:04 thebuck25