hotwired / turbo

The speed of a single-page web application without having to write any JavaScript
https://turbo.hotwired.dev
MIT License
6.65k stars 421 forks source link

Failed to execute 'setAttribute' on 'Element': '{$nonce}' is not a valid attribute name. #675

Closed safeboot closed 2 years ago

safeboot commented 2 years ago

I've installed Turbo on a Laravel project (w/TALL stack) and every time I want to access a page it shows a load bar and it doesn't load the page just stays on the current one even though the URL bar updates.

In console it spits out this error: Uncaught (in promise) DOMException: Failed to execute 'setAttribute' on 'Element': '{$nonce}' is not a valid attribute name.

This is my app.js:

import * as Turbo from "@hotwired/turbo"
Turbo.start();

What gives?

ghiculescu commented 2 years ago

In console it spits out this error: Uncaught (in promise) DOMException: Failed to execute 'setAttribute' on 'Element': '{$nonce}' is not a valid attribute name.

Do you have a backtrace or any more information about this?

safeboot commented 2 years ago

After snooping I found that under the Livewire Scripts comment it shows as this when viewing page source:

<script {$nonce}>
console.warn("Livewire: The published Livewire assets are out of date\n See: https://laravel-livewire.com/docs/installation/")
</script>

Is this supposed to be like this or am I missing something?

safeboot commented 2 years ago

Issue resolved, apologizes!

The issue was that the livewire assets were published in the public folder. Deleting them fixed it!