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

x/website/tour: using the Format button prints "[object Object]" #49746

Closed
nishanths opened this issue Nov 23, 2021 · 4 comments
Closed

x/website/tour: using the Format button prints "[object Object]" #49746

nishanths opened this issue Nov 23, 2021 · 4 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@nishanths
Copy link

nishanths commented Nov 23, 2021

I visited the "A Tour of Go" website at https://go.dev/tour/welcome/1. Then I clicked on the Format button next to the code editor. I expected to see either a human-readable error (if formatting failed) or no feedback (if formatting succeeded). But the output was:

[object Object]

Note that this happens regardless of whether or not the file has syntax errors.

Screenshot

Screen Shot 2021-11-23 at 10 42 48 AM

@gopherbot gopherbot added this to the Unreleased milestone Nov 23, 2021
@nishanths nishanths changed the title x/website/tour: Formatting the code prints "[object Object]" x/website/tour: using the Format button prints "[object Object]" Nov 23, 2021
@seankhliao
Copy link
Member

cc @rsc

@seankhliao seankhliao added the NeedsFix The path to resolution is known, but the work has not been done. label Nov 23, 2021
@esote
Copy link

esote commented Nov 23, 2021

It's making a POST request to /fmt, but for go.dev that gives 404. Seems like a regression from the golang.org to go.dev move

@rsc
Copy link
Contributor

rsc commented Nov 24, 2021

Thanks. It should be using /_/fmt. Will fix.

@rsc rsc self-assigned this Nov 24, 2021
@gopherbot
Copy link

Change https://golang.org/cl/366977 mentions this issue: tour: fix formatting endpoint

@rsc rsc removed their assignment Jun 23, 2022
passionSeven added a commit to passionSeven/website that referenced this issue Oct 18, 2022
go.dev uses /_/fmt, not /fmt.
Fix the JavaScript and then the standalone tour binary to both use /_/fmt too.

Fixes golang/go#49746.

Change-Id: Ic59c6afb99748ed8c3e74c69c2d753671d92432b
Reviewed-on: https://go-review.googlesource.com/c/website/+/366977
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Website-Publish: Russ Cox <rsc@golang.org>
@golang golang locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants