Skip to content

Commit

Permalink
fix: 🐛 add better error message for undefined Merkur
Browse files Browse the repository at this point in the history
  • Loading branch information
mjancarik committed Nov 14, 2024
1 parent 48407e0 commit a2095c3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/cli/src/templates/footer.ejs
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<script>
window.addEventListener('load', function () {
window?.__merkur__?.create(<%- escapeToJSON(widgetProperties) %>)
if (!window.__merkur__) {
console.error('Merkur is not available in the global scope. Make sure you have included Merkur in your project.');
return;
}
window.__merkur__.create(<%- escapeToJSON(widgetProperties) %>)
.then(function (widget) {
widget.containerSelector = widget.containerSelector ?? '.merkur-main';
Expand Down

0 comments on commit a2095c3

Please sign in to comment.