Symfony Webpack: Could not find the entrypoints file from Webpack
A relatively fresh Symfony 4.1.7 project after installing Webpack Encore throws the error
An exception has been thrown during the rendering of a template
("Could not find the entrypoints file from Webpack: the file
".../public/build/entrypoints.json" does not exist.")
where the template includes
{{ encore_entry_link_tags('app') }}
when launching http://127.0.0.1:8000/
What have I missed?
$ yarn encore dev
Running webpack ...
DONE Compiled successfully in 1974ms
I 3 files written to publicbuild
Done in 3.33s.
.../public/build
contains
app.css
app.js
manifest.json
local Symfony versions:
symfony/webpack-encore-bundle v1.0.0
symfony/webpack-encore-pack v1.0.3
webpack.config.js:
var Encore = require('@symfony/webpack-encore');
Encore
// the project directory where compiled assets will be stored
.setOutputPath('public/build/')
// the public path used by the web server to access the previous directory
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
// uncomment to create hashed filenames (e.g. app.abc123.css)
// .enableVersioning(Encore.isProduction())
// uncomment to define the assets of the project
.addEntry('app', './assets/js/app.js')
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app')
// .addStyleEntry('css/app', './assets/css/app.scss')
// uncomment if you use Sass/SCSS files
// .enableSassLoader()
// uncomment for legacy applications that require $/jQuery as a global variable
.autoProvidejQuery()
;
module.exports = Encore.getWebpackConfig();
php symfony webpack
add a comment |
A relatively fresh Symfony 4.1.7 project after installing Webpack Encore throws the error
An exception has been thrown during the rendering of a template
("Could not find the entrypoints file from Webpack: the file
".../public/build/entrypoints.json" does not exist.")
where the template includes
{{ encore_entry_link_tags('app') }}
when launching http://127.0.0.1:8000/
What have I missed?
$ yarn encore dev
Running webpack ...
DONE Compiled successfully in 1974ms
I 3 files written to publicbuild
Done in 3.33s.
.../public/build
contains
app.css
app.js
manifest.json
local Symfony versions:
symfony/webpack-encore-bundle v1.0.0
symfony/webpack-encore-pack v1.0.3
webpack.config.js:
var Encore = require('@symfony/webpack-encore');
Encore
// the project directory where compiled assets will be stored
.setOutputPath('public/build/')
// the public path used by the web server to access the previous directory
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
// uncomment to create hashed filenames (e.g. app.abc123.css)
// .enableVersioning(Encore.isProduction())
// uncomment to define the assets of the project
.addEntry('app', './assets/js/app.js')
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app')
// .addStyleEntry('css/app', './assets/css/app.scss')
// uncomment if you use Sass/SCSS files
// .enableSassLoader()
// uncomment for legacy applications that require $/jQuery as a global variable
.autoProvidejQuery()
;
module.exports = Encore.getWebpackConfig();
php symfony webpack
add a comment |
A relatively fresh Symfony 4.1.7 project after installing Webpack Encore throws the error
An exception has been thrown during the rendering of a template
("Could not find the entrypoints file from Webpack: the file
".../public/build/entrypoints.json" does not exist.")
where the template includes
{{ encore_entry_link_tags('app') }}
when launching http://127.0.0.1:8000/
What have I missed?
$ yarn encore dev
Running webpack ...
DONE Compiled successfully in 1974ms
I 3 files written to publicbuild
Done in 3.33s.
.../public/build
contains
app.css
app.js
manifest.json
local Symfony versions:
symfony/webpack-encore-bundle v1.0.0
symfony/webpack-encore-pack v1.0.3
webpack.config.js:
var Encore = require('@symfony/webpack-encore');
Encore
// the project directory where compiled assets will be stored
.setOutputPath('public/build/')
// the public path used by the web server to access the previous directory
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
// uncomment to create hashed filenames (e.g. app.abc123.css)
// .enableVersioning(Encore.isProduction())
// uncomment to define the assets of the project
.addEntry('app', './assets/js/app.js')
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app')
// .addStyleEntry('css/app', './assets/css/app.scss')
// uncomment if you use Sass/SCSS files
// .enableSassLoader()
// uncomment for legacy applications that require $/jQuery as a global variable
.autoProvidejQuery()
;
module.exports = Encore.getWebpackConfig();
php symfony webpack
A relatively fresh Symfony 4.1.7 project after installing Webpack Encore throws the error
An exception has been thrown during the rendering of a template
("Could not find the entrypoints file from Webpack: the file
".../public/build/entrypoints.json" does not exist.")
where the template includes
{{ encore_entry_link_tags('app') }}
when launching http://127.0.0.1:8000/
What have I missed?
$ yarn encore dev
Running webpack ...
DONE Compiled successfully in 1974ms
I 3 files written to publicbuild
Done in 3.33s.
.../public/build
contains
app.css
app.js
manifest.json
local Symfony versions:
symfony/webpack-encore-bundle v1.0.0
symfony/webpack-encore-pack v1.0.3
webpack.config.js:
var Encore = require('@symfony/webpack-encore');
Encore
// the project directory where compiled assets will be stored
.setOutputPath('public/build/')
// the public path used by the web server to access the previous directory
.setPublicPath('/build')
.cleanupOutputBeforeBuild()
.enableSourceMaps(!Encore.isProduction())
// uncomment to create hashed filenames (e.g. app.abc123.css)
// .enableVersioning(Encore.isProduction())
// uncomment to define the assets of the project
.addEntry('app', './assets/js/app.js')
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app')
// .addStyleEntry('css/app', './assets/css/app.scss')
// uncomment if you use Sass/SCSS files
// .enableSassLoader()
// uncomment for legacy applications that require $/jQuery as a global variable
.autoProvidejQuery()
;
module.exports = Encore.getWebpackConfig();
php symfony webpack
php symfony webpack
asked Nov 22 at 17:48
geoB
3,00412444
3,00412444
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
Update your version constraint in package.json for @symfony/webpack-encore to ^0.21.0
...
"devDependencies": {
"@symfony/webpack-encore": "^0.21.0",
...
add .enableSingleRuntimeChunk() to your webpack.config.js
...
.addEntry('app', './assets/js/app.js')
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app')
// .addStyleEntry('css/app', './assets/css/app.scss')
.enableSingleRuntimeChunk()
...
Then run yarn upgrade or yarn install
PS: If you have symfony/webpack-encore-bundle installed, you can remove symfony/webpack-encore-pack
composer remove symfony/webpack-encore-pack
Many thanks! I noted that your edit re:.enableSingleRuntimeChunk()
removed some deprecation notices. All is (seemingly?) well.
– geoB
Nov 22 at 18:52
@geoB All is well. Thank you.
– David Liebenow
Nov 22 at 19:16
add a comment |
In case somebody is running into a similar issue on staging or production servers: Make sure the asset build is run in the deployment process. On Heroku, for example, you need to use a postinstall script.
{
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.5.0",
"@symfony/webpack-encore": "^0.22.0",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"postinstall": "encore production --progress" // executed during deployment to Heroku
},
"dependencies": {
"bootstrap": "^4.1.3",
"fontawesome": "^4.7.2",
"jquery": "^3.3.1",
"node-sass": "^4.10.0",
"popper.js": "^1.14.6",
"sass-loader": "^7.1.0"
}
}
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53436078%2fsymfony-webpack-could-not-find-the-entrypoints-file-from-webpack%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
Update your version constraint in package.json for @symfony/webpack-encore to ^0.21.0
...
"devDependencies": {
"@symfony/webpack-encore": "^0.21.0",
...
add .enableSingleRuntimeChunk() to your webpack.config.js
...
.addEntry('app', './assets/js/app.js')
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app')
// .addStyleEntry('css/app', './assets/css/app.scss')
.enableSingleRuntimeChunk()
...
Then run yarn upgrade or yarn install
PS: If you have symfony/webpack-encore-bundle installed, you can remove symfony/webpack-encore-pack
composer remove symfony/webpack-encore-pack
Many thanks! I noted that your edit re:.enableSingleRuntimeChunk()
removed some deprecation notices. All is (seemingly?) well.
– geoB
Nov 22 at 18:52
@geoB All is well. Thank you.
– David Liebenow
Nov 22 at 19:16
add a comment |
Update your version constraint in package.json for @symfony/webpack-encore to ^0.21.0
...
"devDependencies": {
"@symfony/webpack-encore": "^0.21.0",
...
add .enableSingleRuntimeChunk() to your webpack.config.js
...
.addEntry('app', './assets/js/app.js')
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app')
// .addStyleEntry('css/app', './assets/css/app.scss')
.enableSingleRuntimeChunk()
...
Then run yarn upgrade or yarn install
PS: If you have symfony/webpack-encore-bundle installed, you can remove symfony/webpack-encore-pack
composer remove symfony/webpack-encore-pack
Many thanks! I noted that your edit re:.enableSingleRuntimeChunk()
removed some deprecation notices. All is (seemingly?) well.
– geoB
Nov 22 at 18:52
@geoB All is well. Thank you.
– David Liebenow
Nov 22 at 19:16
add a comment |
Update your version constraint in package.json for @symfony/webpack-encore to ^0.21.0
...
"devDependencies": {
"@symfony/webpack-encore": "^0.21.0",
...
add .enableSingleRuntimeChunk() to your webpack.config.js
...
.addEntry('app', './assets/js/app.js')
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app')
// .addStyleEntry('css/app', './assets/css/app.scss')
.enableSingleRuntimeChunk()
...
Then run yarn upgrade or yarn install
PS: If you have symfony/webpack-encore-bundle installed, you can remove symfony/webpack-encore-pack
composer remove symfony/webpack-encore-pack
Update your version constraint in package.json for @symfony/webpack-encore to ^0.21.0
...
"devDependencies": {
"@symfony/webpack-encore": "^0.21.0",
...
add .enableSingleRuntimeChunk() to your webpack.config.js
...
.addEntry('app', './assets/js/app.js')
// .addEntry('js/app', './assets/js/app.js')
// .addStyleEntry('css/app')
// .addStyleEntry('css/app', './assets/css/app.scss')
.enableSingleRuntimeChunk()
...
Then run yarn upgrade or yarn install
PS: If you have symfony/webpack-encore-bundle installed, you can remove symfony/webpack-encore-pack
composer remove symfony/webpack-encore-pack
edited Nov 22 at 18:49
answered Nov 22 at 18:26
David Liebenow
563
563
Many thanks! I noted that your edit re:.enableSingleRuntimeChunk()
removed some deprecation notices. All is (seemingly?) well.
– geoB
Nov 22 at 18:52
@geoB All is well. Thank you.
– David Liebenow
Nov 22 at 19:16
add a comment |
Many thanks! I noted that your edit re:.enableSingleRuntimeChunk()
removed some deprecation notices. All is (seemingly?) well.
– geoB
Nov 22 at 18:52
@geoB All is well. Thank you.
– David Liebenow
Nov 22 at 19:16
Many thanks! I noted that your edit re:
.enableSingleRuntimeChunk()
removed some deprecation notices. All is (seemingly?) well.– geoB
Nov 22 at 18:52
Many thanks! I noted that your edit re:
.enableSingleRuntimeChunk()
removed some deprecation notices. All is (seemingly?) well.– geoB
Nov 22 at 18:52
@geoB All is well. Thank you.
– David Liebenow
Nov 22 at 19:16
@geoB All is well. Thank you.
– David Liebenow
Nov 22 at 19:16
add a comment |
In case somebody is running into a similar issue on staging or production servers: Make sure the asset build is run in the deployment process. On Heroku, for example, you need to use a postinstall script.
{
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.5.0",
"@symfony/webpack-encore": "^0.22.0",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"postinstall": "encore production --progress" // executed during deployment to Heroku
},
"dependencies": {
"bootstrap": "^4.1.3",
"fontawesome": "^4.7.2",
"jquery": "^3.3.1",
"node-sass": "^4.10.0",
"popper.js": "^1.14.6",
"sass-loader": "^7.1.0"
}
}
add a comment |
In case somebody is running into a similar issue on staging or production servers: Make sure the asset build is run in the deployment process. On Heroku, for example, you need to use a postinstall script.
{
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.5.0",
"@symfony/webpack-encore": "^0.22.0",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"postinstall": "encore production --progress" // executed during deployment to Heroku
},
"dependencies": {
"bootstrap": "^4.1.3",
"fontawesome": "^4.7.2",
"jquery": "^3.3.1",
"node-sass": "^4.10.0",
"popper.js": "^1.14.6",
"sass-loader": "^7.1.0"
}
}
add a comment |
In case somebody is running into a similar issue on staging or production servers: Make sure the asset build is run in the deployment process. On Heroku, for example, you need to use a postinstall script.
{
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.5.0",
"@symfony/webpack-encore": "^0.22.0",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"postinstall": "encore production --progress" // executed during deployment to Heroku
},
"dependencies": {
"bootstrap": "^4.1.3",
"fontawesome": "^4.7.2",
"jquery": "^3.3.1",
"node-sass": "^4.10.0",
"popper.js": "^1.14.6",
"sass-loader": "^7.1.0"
}
}
In case somebody is running into a similar issue on staging or production servers: Make sure the asset build is run in the deployment process. On Heroku, for example, you need to use a postinstall script.
{
"devDependencies": {
"@fortawesome/fontawesome-free": "^5.5.0",
"@symfony/webpack-encore": "^0.22.0",
"webpack-notifier": "^1.6.0"
},
"license": "UNLICENSED",
"private": true,
"scripts": {
"dev-server": "encore dev-server",
"dev": "encore dev",
"watch": "encore dev --watch",
"postinstall": "encore production --progress" // executed during deployment to Heroku
},
"dependencies": {
"bootstrap": "^4.1.3",
"fontawesome": "^4.7.2",
"jquery": "^3.3.1",
"node-sass": "^4.10.0",
"popper.js": "^1.14.6",
"sass-loader": "^7.1.0"
}
}
answered Dec 18 at 7:48
Chrisissorry
65411230
65411230
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53436078%2fsymfony-webpack-could-not-find-the-entrypoints-file-from-webpack%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown