Skip to content

Commit

Permalink
Prevent redefining 'alchemy-menubar' custom element when using Turbo
Browse files Browse the repository at this point in the history
This commit uses `data-turbo-eval="false"` to prevent defefining
'alchemy-menubar' custom element when navigating between pages with
Turbo.
Without this, we are getting the following error after each
`Turbo.visit`:
```
Uncaught DOMException: CustomElementRegistry.define: 'alchemy-menubar' has already been defined as a custom element
```
  • Loading branch information
gdott9 committed Nov 22, 2024
1 parent a244b6b commit 1f31c91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/views/alchemy/_menubar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
</div>
</template>

<script type="module">
<script type="module" data-turbo-eval="false">
class Menubar extends HTMLElement {
constructor() {
super()
Expand Down

0 comments on commit 1f31c91

Please sign in to comment.