Replies: 1 comment
-
|
defer should not be the problem. I think the issue is rather that your function "mycomponent" was not loaded before alpine is loaded. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm able to plot and interact with a barchart using Alpine.js and D3.js. It works pretty well as you can see in this fiddle. But when I transpose the code into Laravel 9 with Alpine 3, no matter where I put the js code (in the head, in the bottom of the body, just before the buttons) it always says the component is not defined.
I'm running everything in a Raspberry Pi 4 with 8MB RAM, serving with nginx and using Chromium 98.0.4758.106.
Here you have the main codes (almost just like in the fiddle) in a fresh Laravel 9 + Breeze installation:
dashboard.blade.php
And here the data.js
And finally the error messages:
== EDIT 1 ==
Based on #2828 I had deleted defer from the script call, so the js file doesn't load necessary after page load. Unfortunatelly the error still occurs.
Beta Was this translation helpful? Give feedback.
All reactions