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

Monaco is causing an infinite iframe recursion #1278

Closed
pinage404 opened this issue Feb 7, 2024 · 0 comments · Fixed by #1308
Closed

Monaco is causing an infinite iframe recursion #1278

pinage404 opened this issue Feb 7, 2024 · 0 comments · Fixed by #1308
Labels
bug Something isn't working monaco target: build

Comments

@pinage404
Copy link

pinage404 commented Feb 7, 2024

Describe the bug
Monaco is causing an infinite iframe recursion

To Reproduce
I did a repository to isolate and reproduce the problem :
https://gitlab.com/pinage404/slidev_with_monaco/-/blob/main/slides.md

⚠️ https://pinage404.gitlab.io/slidev_with_monaco ⬅️ this tab is causing memory leak with an infinite iframe recursion ⚠️

Steps to reproduce the behavior:

  1. Install slidev
  2. Use a Monaco code block in your slide
  3. In front matter, enable Monaco even in the exported SPA : monaco: true
  4. Build to SPA : slidev build
  5. Host the SPA with something that respect the _redirect file
  6. Go to the SPA

Your memory will be eaten until crash or kill

Desktop (please complete the following information):

  • OS: NixOS 23.11.20240124.a77ab16 (Tapir)
  • Browser: Firefox 121.0.1 (64 bits) & Chromium Version 120.0.6099.224 (Build officiel) (64 bits)
  • Slidev version: 0.46.3 & 0.47.4

Possible cause :

  1. Export the slide to SPA slidev build
  2. Host it
  3. Go to the SPA
  4. It will do a request to /iframes/monaco/assets/index-z9jPtVTR.js (or other hash) which is not in built the SPA

With a server that respect the _redirect file
The iframe's assets are not found, so redirected to the index page, which will load Monaco in an iframe where the assets are not found, so redirect to the index page ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working monaco target: build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants