Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webpack-encore not working correctly in a live server #1238

Open
ybico opened this issue Nov 25, 2023 · 0 comments
Open

webpack-encore not working correctly in a live server #1238

ybico opened this issue Nov 25, 2023 · 0 comments

Comments

@ybico
Copy link

ybico commented Nov 25, 2023

After deploying only the build folder on my live website, the following tags:

{{ encore_entry_link_tags('app') }}
and
{{ encore_entry_script_tags('app') }}

no longer work.
So, for the moment, I am using the previous tags:

<link rel="stylesheet" href="{{ active('build/app.573ca45c.css') }}">
and
<script src="{{ active('build/app .2d1f7652.js') }}"></script>

which are a momentary ugly solution, pointing directly to the hashed files, because it does not catch the links provided by the manifest.json file either.
I have the manifest.json and entrypoints.json files successfully built, but the magic of webpack encore is gone on the live server.

// manifest.json
{
"build/app.css": "/build/app.573ca45c.css",
"build/app.js": "/build/app.2d1f7652.js",
"build/runtime.js": "/build/runtime.600ac592.js",
"build/386.09d9c820.css": "/build/386.09d9c820.css",
"build/386.92a54516.js": "/build/386.92a54516.js",
"build/images/fontawesome-webfont.svg?v=4.7.0": "/build/images/fontawesome-webfont.c1e38fd9.svg",
"build/fonts/fontawesome-webfont.eot": "/build/fonts/fontawesome-webfont.8b43027f.eot",
"build/fonts/fontawesome-webfont.ttf?v=4.7.0": "/build/fonts/fontawesome-webfont.1e59d233.ttf",
"build/fonts/fontawesome-webfont.woff?v=4.7.0": "/build/fonts/fontawesome-webfont.f691f37e.woff",
"build/fonts/fontawesome-webfont.woff2?v=4.7.0": "/build/fonts/fontawesome-webfont.20fd1704.woff2",
"build/images/rwbag.png": "/build/images/rwbag.0105f3ae.png",
"build/images/ivanvino.png": "/build/images/ivanvino.95f81f89.png",
"build/images/wine-icon.ico": "/build/images/wine-icon.f60a8ed2.ico",
"build/images/symfony-logo.svg": "/build/images/symfony-logo.579acd4f.svg"
}

// entrypoints.json
{
"entrypoints": {
"app": {
"js": [
"/build/runtime.600ac592.js",
"/build/386.92a54516.js",
"/build/app.2d1f7652.js"
],
"css": [
"/build/386.09d9c820.css",
"/build/app.573ca45c.css"
]
}
}
}

My question is, why does webpack encore become faddy on a live web server or am I doing something wrong ?
I will appreciate any help guiding me in this matter.

PS,

local machine: Ubuntu 20.04, PHP 8.1, Symfony 6.3, Symfony built-in server
live server: Godaddy, linux hosting, PHP 8.1, Symfony 6.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant