I got Uncaught SyntaxError: Unexpected token error when I try to add js file #2461
Replies: 5 comments 3 replies
-
Hi @sergeynilov, It looks like you are trying to load a 404 HTML page
|
Beta Was this translation helpful? Give feedback.
-
Hi @tabuna, |
Beta Was this translation helpful? Give feedback.
-
Usually when I work under dev : I try to run production :
and I found my file under “public/build/js/custom.js/custom.js” path...
|
Beta Was this translation helpful? Give feedback.
-
I don't know if you had found the solution, i had the same probleme and i solved it like this : In the config array, change the ressource key like this : So for the moment no import in my dashboard script :s |
Beta Was this translation helpful? Give feedback.
-
I had the same problem as @methos02 and solved it as follow:
The documentation is updated for v14, where you have @Vite directive by default in the app.blade.php file. @tabuna will be wonderful if somehow you have different documentation for different major platform versions. Thanks for your hard work, Orchid is amazing! |
Beta Was this translation helpful? Give feedback.
-
Hello I try to add JS support into my laravel/framework 9.1 admin area with orchid/crud 3.8 and orchid/platform 13.6 app
and reading
https://orchid.software/en/docs/javascript/#stimulus
I do next:
As My project have vite.config.js file I added :
I added line into config/platform.php file :
I have a screen file app/Orchid/Screens/CategoryCrudScreen.php and I want to attach JS file to it.
In file app/Providers/AppServiceProvider.php I added :
I added file resources/js/controllers/category.js with content :
import CategoryController from "./controllers/category"
console.log('resources/js/dashboard.js::')
application.register("category", CategoryController);
Uncaught SyntaxError: Unexpected token '<' (at VM717 dashboard.js:1:1)
dashboard.js:1 Uncaught SyntaxError: Unexpected token '<' (at dashboard.js:1:1)
Beta Was this translation helpful? Give feedback.
All reactions