Skip to content

Example programs in 'Rust by Example' return 'undefined' in browser #52871

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

Closed
bitfield opened this issue Jul 30, 2018 · 5 comments
Closed

Example programs in 'Rust by Example' return 'undefined' in browser #52871

bitfield opened this issue Jul 30, 2018 · 5 comments
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.

Comments

@bitfield
Copy link
Contributor

Example: https://doc.rust-lang.org/rust-by-example/hello.html

Clicking the 'Run' button to run the code example prints 'undefined' instead of the expected "Hello world!". I looked at a few other examples, but they all fail in the same way.

@estebank estebank added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Jul 30, 2018
@kennytm kennytm added T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Jul 30, 2018
@kennytm
Copy link
Member

kennytm commented Jul 30, 2018

This is because play.rust-lang.org recently changed its (private) API. We need to update these lines in mdbook:

https://github.com/rust-lang-nursery/mdBook/blob/29b3ff14c7e47c62f331080e3a92bf5c2484cf52/src/theme/book.js#L112-L119

cc @shepmaster (playground) @mattico @Michael-F-Bryan (mdbook).

@frewsxcv
Copy link
Member

Should we look into reverting the play.rust-lang.org API for now? Having it broken for two release cycles seems doesn't seem ideal

@shepmaster
Copy link
Member

I've added default values to that API for now. There are zero reliability guarantees for every playground API except /evaluate.json.

@mattico
Copy link
Contributor

mattico commented Jul 31, 2018

mdbook 0.1.10 has a fix for this issue, though most existing documentation will likely not be rebuilt. I'll make sure we switch to the /evaluate.json endpoint for the next release (rust-lang/mdBook#753).

@steveklabnik
Copy link
Member

This has been fixed. Closing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. T-infra Relevant to the infrastructure team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants