question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tinymce ignoring preload css static files - redownloads them

See original GitHub issue

Method

  1. Constructed a simple page with TinyMce Vue component
  2. Make sure the application JS imports the TinyMce Vue JS
  3. Load the page

Expected Results The preload css libraries to be utilised instead of redownloading. The preload will shorten the page load times.

Actual Results The preload css libraries are downloaded again, causing;

  1. Slower page load times
  2. Unnecessary bandwidth usage
  3. Worse Lighthouse score

My code references

The HEAD component

    <!-- tinymce -->
    <link rel="preload" href="NearBeach/tinymce/skins/ui/oxide/skin.min.css" as="style">
    <link rel="preload" href="NearBeach/tinymce/skins/content/default/content.min.css" as="style">
    <link rel="preload" href="NearBeach/tinymce/skins/ui/oxide/content.min.css" as="style">
    <script defer type="text/javascript" src="NearBeach/tinymce/tinymce.min.js"></script>

The BODY component

    <!-- MAIN COMPONENT -->
    <main class="container" role="main">
        <div id="app">
            <editor
               :init="{
                 height: 500,
                 menubar: false,
                 toolbar: 'undo redo | formatselect | ' +
                  'bold italic backcolor | alignleft aligncenter ' +
                  'alignright alignjustify | bullist numlist outdent indent | ',
               }"
            />
        </div>
    </main>

    <!-- Load NearBeach Webpack File -->
    <script defer type="text/javascript" src="NearBeach/NearBeach.min.js"></script>

The NearBeach.min.js uncompiled code can be found in my project here - https://github.com/robotichead/NearBeach/blob/main/src/js/app.js

The NearBeach mock tinymce template (referenced in the code above) can be found here - https://github.com/robotichead/NearBeach/blob/tinymce_tests/NearBeach/templates/NearBeach/temp/tinymce.html

When I load the page, I expect the preloaded CSS files will be utilised within TinyMce, instead they are not and they are re-downloaded. This can be seen within the network console

image

It is also noted in Chrome’s Lighthouse

image

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
jscascacommented, Oct 27, 2020

To the best of my knowledge, you can use skin:false and content_css:false to stop the editor from attempting to load the CSS. In that case you will need to manually load the CSS. Otherwise, the editor will try to load the files when initialising.

0reactions
exalate-issue-sync[bot]commented, Sep 28, 2021

Ref: INT-2666

Read more comments on GitHub >

github_iconTop Results From Across the Web

content_css - TinyMCE
This CSS file is the one used within the editor (the editable area). This option can also be a comma separated list of...
Read more >
Most common plugin errors in TinyMCE and how to fix them
Ways to fix the most common plugin errors in TinyMCE and why those happen, including “TinyMCE failed to load plugin” error.
Read more >
How to get content from the editor and set content | TinyMCE
Confirm whether the TinyMCE editor has been initialized before your setContent script runs. Remember that you can place the setContent method so ...
Read more >
React integration | Docs - TinyMCE
Install the tinymce-react package and save it to your package.json with --save ... contentUiCss from '!!raw-loader!tinymce/skins/ui/oxide/content.min.css'; ...
Read more >
Troubleshoot server-side components | Docs - TinyMCE
General troubleshooting advice · Verify that that your JavaScript configuration is correct for the relevant TinyMCE plugin. · Ensure that your firewall has...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found