Comments (3)
🚚 Transferred the issue from marp-team/marp-vscode to marp-team/marp-core because it originates from the browser-side script of Marp Core.
TL;DR: The reported errors do not cause any problems in rendering Marp slides.
from marp-core.
This is due to the different behavior between Firefox and Chrome when defining the Marp Core's Web Component (<marp-pre>
for auto-scaling code blocks in <pre>
elements) using the is
attribute.
When <marp-pre>
component defined (at loading slides), both browsers tries to upgrade existing <pre is="marp-pre">
elements. While upgrading, there is a difference in each browser whether the element is already recognized as <marp-pre>
at the time of setting the Shadow DOM in the constructor.
In Firefox, <pre>
is not yet upgraded to <marp-pre>
until initialization of the custom element (constructor) is over. <pre>
element cannot attach the Shadow DOM due to security reasons, so the browser raises NotSupportedError
for each <pre>
elements.
In Chrome,
<pre>
is already upgraded to<marp-pre>
while running constructor of the custom element.<marp-pre>
is allowed to attach custom element so any exceptions will not bring when attaching Shadow DOM.
However, they are browser-side errors that occurs when updating the definition of existing HTML elements, and they do not stop the main JavaScript thread due to the exception. The subsequent processes in the script (more reliable Web Component upgrade process, to deal with upgrade failures in Firefox and Safari) will be continue without any problems, so there are not any problems in rendering Marp slides.
from marp-core.
Ideas to suppress errors:
-
Swap the order of processes, to run more reliable Web Component upgrade before defining Web Components. With this approach, there is a possibility that the browser will display undefined elements for a brief period until the web components are defined.
-
Simply catch and silence the exception. In this case, the component may be incomplete state until an explicit update process is performed.
from marp-core.
Related Issues (20)
- Emoji plugin: Allow using other emoji vendors HOT 3
- [bug] import failure `i is not a function` HOT 5
- Trouble rendering HTML and Markdown in the same line HOT 1
- A Marp constructor option, emoji.twemoji.base, seems not working HOT 1
- Overriding hljs-attr color does not work HOT 2
- [Regression] Auto-scaling for KaTeX block is always enable regardless of `@auto-scaling` theme metadata
- TypeError: u2 is not a function HOT 7
- Nanoid error HOT 4
- Images gallery HOT 1
- per-element animations HOT 2
- How to create, publish and use a theme? HOT 1
- Enable support for HTML code snippets by default HOT 3
- Add support for hgroup HOT 2
- Transparent images broken with regular `[]()` tags but not with `[bg]()` HOT 2
- [v4] Always treat the slide container of built-in themes as block element
- Support for merge cells in tables HOT 5
- Uncaught Error: Dynamic require of "punycode" is not supported HOT 1
- Normal code strings don't get highlighted correctly HOT 1
- Set starting number for `ol` when list is interrupted HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from marp-core.