Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

skoobi's avatar
Level 13

Uncaught TypeError: window.Alpine.cloneNode is not a function

i. Not sure whats happened as this started to occur this morning after no changes were made.

All was working last night as I was testing and all was working, but this morning I now get: Uncaught TypeError: window.Alpine.cloneNode is not a function.

I reverted back to earlier git commits to see where it broke, but even the earliest commits have the same issue which I know it was all working then.

Theres nothing in the logs and I just can't figure this one out.

Any ideas ?

0 likes
7 replies
skoobi's avatar
skoobi
OP
Best Answer
Level 13

So i found the error. Not sure why this was the case, the file was unchanged from the start.

In app.js

From this:

import './bootstrap';
window.Alpine = Alpine
Alpine.start()

to this:

import './bootstrap';
// window.Alpine = Alpine
// Alpine.start()

And it all worked as it should.

5 likes
csaba_szekely's avatar

@skoobi If I remove these two lines from app.js and I don't have a livewire component on some page then alpine.js is not started, only where I have a livewire component is alpine.js working.

johanjaimes's avatar

I am cloning the first example of Livewire 3 docs (Filtering users with an input text field) and the component was not re-rendering after updating the $search property. After updating \resources\js\app.js to... everything is working as expected.

import './bootstrap';
import Alpine from 'alpinejs';
//
// window.Alpine = Alpine;
// Alpine.start();
marcoponne's avatar

I experienced the same error, running livewire 3 with laravel with docker locally

Uncaught TypeError: window.Alpine.cloneNode is not a function

fixed it with

sail npm run dev
qingmu's avatar

It seems to be a problem with the vite package, the alpine js provided by livewire includes cloneNode but the vite package does not.

// in app.js 
console.log('Import Alpine', Alpine.version, Object.keys(Alpine).sort());
console.log('Window Alpine', window.Alpine.version, Object.keys(window.Alpine).sort());

Alpine.start();
qingmu's avatar

I checked the file from node_module and found that the result of downloading the alpinejs package does not contain the cloneNode

qingmu's avatar

resolve livewire.laravel.com/docs/upgrading#including-via-js-bundle

link1: github.com/livewire/livewire/discussions/6238

Please or to participate in this conversation.