Issue #3449πŸ’¬ AnsweredOpened May 11, 2021by chiragkataria220 reactions

Switching pages calls canvas styles and scripts again and again

Quick answerby chiragkataria22

@artf Can you please help?

Read full answer below ↓

Question

Hi

I am integrating page manager into my project. But the issue I am facing is that whenever I switch between pages it loads CSS and script files given in canvas object at the time of init, again and again.

It makes the switching between pages slow.

Implementation:

grapesjs.init({ pageManager: { pages: [ { id: 'Page-1', styles: ``, // or a JSON of styles component: '', // or a JSON of components name: 'Page 1', }, ], },

  canvas: {
    styles: [
      '../assets/bootstrap/bootstrap.min.css',
      '../assets/platforma/platforma.min.css',
      '../assets/editor.css',
    ],
    scripts: [
      '../assets/bootstrap/jquery-3.5.1.slim.min.js',
      '../assets/bootstrap/bootstrap.bundle.min.js',
      '../assets/platforma/platforma.bundle.min.js',
    ],
  },

})

after that, I am adding pages manually on click of a button

Answers (3)

chiragkataria22β€’ May 12, 2021

@artf Can you please help?

artfβ€’ May 22, 2021

Unfortunately, switching pages creates a new iframe so, the behavior is correct. I preferred to remove previous iframes in order to keep the memory usage as low as possible. One solution might be to find a way to reuse previous iframes but that might cause context issues with external JS... so I'm not sure how to properly prevent this behavior. Anyway, to be honest I'd not expect switching so slow after the first load as external files should be cached by the browser... are you able to create a screencast of your experience?

ClaudeCodeβ€’ May 17, 2026

Thanks for reporting this, @chiragkataria22.

Thanks for sharing your report about Switching pages calls canvas styles and scripts again and again. To help the team investigate and prioritize this:

Please provide:

  1. A minimal reproducible example (CodeSandbox/JSFiddle)
  2. Your GrapesJS version number
  3. Browser and OS information
  4. Any error messages from the browser console
  5. Steps to reproduce the issue

What helps most:

  • Minimal code example (not your full project)
  • Screen recording or screenshot showing the issue
  • Expected vs actual behavior clearly stated
  • GrapesJS configuration you're using

With these details, the maintainers can identify and prioritize a fix much faster. The GrapesJS team is very responsive to well-documented issues.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Free option

Check the open-source GrapesJS plugins on GitHub or run a quick search in our free catalog.

Browse free plugins β†’
Premium option

Premium plugins ship with support, regular updates, and production-ready features β€” save days of integration work.

Browse premium plugins β†’

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.