Registering JavaScript File that imports from moment-timezone package in Laravel 11 project #15278
Unanswered
danielh-official
asked this question in
Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Package
Panel builder
Package Version
v3.2.132
How can we help you?
AppServiceProvider.php
timezone.js
Expected Behavior
I run
php artisan filament:assets
.When I refresh a Filament page, I want it to run the code in
timezone.js
and store the timezone in the cookies.What Actually Happens
At
timezone.js:1:1
, I get the following error:Uncaught SyntaxError: import declarations may only appear at top level of a module
in the browser console. The cookie is nowhere to be found. I am using Firefox.timezone.js
is also used byapp.js
, and when I refresh the defaultwelcome.blade.php
page, it runs all the code correctly. So this must mean that the Laravel Blade views have something that the Filament views are missing.But I don't know what the problem is.
Beta Was this translation helpful? Give feedback.
All reactions