I am having issues with a fresh installation using docker + laravel + vite.
I can currently load the blade template successfully, however, when I load my file in resources/js/app.js, it is failing as it cannot find the file.
In my blade template, I use #vite('resources/js/app.js') to load this file.
If I run npm run build it loads the file successfully, but if I am working with them by using the HRM npm run dev, laravel cannot find this file.
How can I resolve this? Should I move to mix for this?
Vite port was not exposed in my dockerfile. Now it works perfectly :D
Related
I'm actually working on the server migration of a Symfony project. I'm new to Symfony so i'm discovering how a Symfony project works at the same time.
The projet use Symfony 4.
I'm stuck at the point where the deployment on the production server works but once on the website side, images and .css files cannot be loaded.
I get the following error in the console : console error
When I look at the path where images are loaded I get http://domainname/builg/images/imagename.jpg
I have check and the images are well located in the folder public/build/images in the server.
I've tried accessing the images directly by doing a GET request on the search bar but I can't have access whether it is by asking http://domainname/build or http://domainname/public/images
As the project is actually perfectly running on another server and locally on my computer I don't think the issue come from twig or the webpack encore.
I can't see what I've done wrong.
Maybe have I missed something in the configuration phase ? Should I update some path ?
Thanks in advance,
I assume you are using Symfony 6 or 5. Please follow these steps:
php bin/console cache:clear --env=prod
npm run build
OR
yarn run build
assets are auto symlink in latest symfony 5 or 6 version. If not then please run this command:
php bin/console assets:install --symlink
And try to access http://domainname/build/images/imagename.jpg . Make sure this url is correct with image name and path.
I am working in project having technology(laravel + vuejs).In that there is a form created in vue file and i want to add a text in the vue file.So as i have seen that "when any changes is done in vue file then need to rebuild the application".And i see that there are commands for rebuild the application is npm run dev , npm run prod , npm run watch and npm run watch-poll. I have tried all this commands after saving the file through FTP but sometimes the changes is applied (Note : Not immediately but after some duration) and sometimes no changes apply in the browser.When i tried the above command by executing it then there is no such error occurs and the rebuild is done successfully.So what will be the issue can you please suggest something that i need to configure?
Below is the code of package.json,webpack.mix.js file and after that i have attached image of putty in which application rebuild is done.
Thanks in advance!
I think you are not understanding what npm run dev/prod/watch do. If you alter the .vue file in your resources folder, then have npm rebuild your assets, then ftp the vue file to your server, nothing should happen.
Depending on how you have your laravel mix file set-up, the file you need to ftp to the server is likely public/js/app.js.
You should really consider getting your local environment setup for development, there is nothing I can image worse than viewing your changes by ftp-ing files to a server.
sb-admin-laravel-5-master theme is trying set up on my existed laravel project.
I have copied resources/view/ to my existed laravel project at resources/view/.
but problem is not working css or other stuffs as in theme and console has error
Loading failed for the with source “http://localhost/test1/ytl/public/assets/scripts/frontend.js”.
also done scripts folder:
If you use Gulp (gulpfile.js in your root folder) in your project, go to the root folder and run gulp in your console.
If you use Webpack (webpack.mix.js in your root folder), go to the root folder and run npm run dev in your console.
Of course in your gulpfile.js/webpack.mix.js-file there must be a copy command in it so it copies something from resources/assets/js/* to public/scripts/*.
For the gulpfile.js it would look similar to this:
mix.copy('resources/assets/js', 'public/build/js');
I followed the docs in the official website. The problem is I use webpack as my bundler instead of brunch. The deployment is successful. I can even access the api routes. My only problem is the assets (js,css) in the homepage is not found. Locally, I can access the home page successfully when I run mix phoenix.server.
I tried peeking at the priv/static folder in heroku (using heroku run bash) where the files are moved after being compiled and saw the asset files there. Did I miss anything? or a configuration that I should put?
Here is the remote deploy output
http://pastebin.com/1mL1YWTS
Here is my custom compile file (to override phoenix-static buldpack)
http://pastebin.com/BGHf9xBK
Here is my webpack.config.js
http://pastebin.com/Xv2E1yCE
I have used webpack with the following compile:
./node_modules/.bin/webpack -p
mix phoenix.digest
You need to call mix phoenix.digest to generate a manifest that can be used in the static path helpers. http://hexdocs.pm/phoenix/Mix.Tasks.Phoenix.Digest.html#run/1
Im building a little application with symfony2 everything worked fine and i just did a
php composer.phar update
Which make the project unable to run , now i got 3 different error that I can't solve .
1 - When i hit the root url "/" of project or "/app_dev.php"
2- When i run php composer.phar install --profile i get this error
3- When i run php composer.phar update --profile i get this error
I tried to delete the cache by hand of both symfony and composer , it did absolutly nothing
Any solution with this terrible package manager ?
Solved , the name canno't exceed 260 Charcters under windows .
Had to change the path of my project to shorten the url .
See github for detail
https://github.com/composer/composer/issues/2712