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

samples issue reproducer #3553

Closed
wants to merge 1 commit into from
Closed

samples issue reproducer #3553

wants to merge 1 commit into from

Conversation

whyoleg
Copy link
Contributor

@whyoleg whyoleg commented Mar 29, 2024

related: #3535 (comment)

Problem

During update of Dokka to latest version (2.0.0-dev-323) in kotlin stdlib I found, that samples are not runnable anymore (playground is not loading)
Example:
image

Not reproducible with Dokka 1.9.10 and 1.9.20.

After some investigation I found that scripts/main.js is different when building with 1.9.20 and 2.0.0-dev-323.
After some additional check of older 2.0.0-dev-* versions I found, that the issue started to appear after #3413
If to revert package-lock.json changes samples are runnable again:
image

Reproducing

Reproducer project is in PR. It's not an integration test, as it's not possible to render produced HTML there, and as the issue in js script there is no way to test it.

I've left some comments on how to reproduce the issue n examples/gradle/dokka-runnable-samples-example/README.md, will inline here just to understand the idea:

Note: better to change the version every time there are some changes happened,
as Gradle caches something badly and so main.js could not change in final HTML distribution.

To reproduce (from the root of the project):

rm -rf dokka-subprojects/plugin-base-frontend/node_modules
./scripts/testDokka.sh -d examples/gradle/dokka-runnable-samples-example -v 2.0.0-samples-issue-SNAPSHOT

Everything works fine if to revert commit which changes package-lock.json (155efa4):

git revert 155efa425bad65f6171b9c39aa6c25ce3cf85a83 --no-edit --no-commit
rm -rf dokka-subprojects/plugin-base-frontend/node_modules
./scripts/testDokka.sh -d examples/gradle/dokka-runnable-samples-example -v 2.0.0-samples-issue-fixed-package-json-SNAPSHOT

@berezinant Could you take a look?

@whyoleg whyoleg requested a review from berezinant March 29, 2024 14:08
@IgnatBeresnev
Copy link
Member

JFYI: I had a similar problem that I could reproduce even with Dokka 1.9.20:

image

After @atyrin said that it worked for him without any problems, I tried to reproduce it again with a VPN on, and it worked! I have DNS-level ad blocking on my local network, which I figured was blocking some resources that were needed to load the scripts. After turning the VPN on, it started using other DNS servers (without adblock), so the scripts and thus the samples got resolved correctly. Do you, by any chance, have Pi-hole or something similar running locally?

as the issue in js script there is no way to test it.

The test project added in #3509 will be used for UI screenshot tests (I believe I added some @sample usages to it), which should catch such kinds of problems (it should spin a web browser, wait for the page to load, including js scripts, then make a screenshot and compare it to the previous version's screenshot).

@whyoleg
Copy link
Contributor Author

whyoleg commented Apr 2, 2024

New information:

Dokka 2.0.0-dev-323:

  • Google Chrome - works
  • Safari - doesn't work

Enabling/Disabling VPN/adblock doesn't affect results for both Chrome (works) and Safari (doesn't work)

Dokka 1.9.20:

  • Google Chrome - works
  • Safari - works

@whyoleg
Copy link
Contributor Author

whyoleg commented May 7, 2024

The issue should be fixed in scope of #3596.
Testing of such issues will be done using ui-showcase project and #3579.
This PR is no longer needed.

@whyoleg whyoleg closed this May 7, 2024
@berezinant berezinant added the feedback: KTL Feedback from the Kotlin Website team, most likely related to frontend issues label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feedback: KTL Feedback from the Kotlin Website team, most likely related to frontend issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants