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

Docs seem to be missing something ? #183

Open
udf2457 opened this issue Jun 18, 2022 · 1 comment
Open

Docs seem to be missing something ? #183

udf2457 opened this issue Jun 18, 2022 · 1 comment

Comments

@udf2457
Copy link

udf2457 commented Jun 18, 2022

Apologies for the obscure title but I'm ramming my head against a brick wall here !

According to the docs, all you need to do is:

  1. composer require symfony/webpack-encore-bundle
  2. yarn install

But although the commands run successfully on my machine, the result is something that does not work. Because if we proceed further (as instructed "You can skip the rest of this article and go write your first JavaScript and CSS by reading Encore: Setting up your Project!"), we are told that we can run commands such as:

  • yarn watch
  • yarn dev
  • yarn build

But this is evidently far from the truth:

yarn run v1.22.19
warning package.json: No license field
error Command "build" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Following internet searches, I have tried yarn install --production=false but it makes no difference. Equally running composer require webpack makes no difference and neither does recipes:install symfony/webpack-encore-bundle --force -v.

There is no node_modules/.bin/encore and package.json makes no mention of anything (it only lists my own @popperjs/core and bootstrap yarn additions).

So it seems somebody has been over-optimistic about the minimal steps required to get it working, and it would be nice to see the docs corrected accordingly !

My environment

yarn version v1.22.19
node v18.4.0
PHP 8.1.7
Debian bullseye

My symphony dir was created using composer create-project symfony/skeleton:"6.1.*" foobar and all yarn commands are being run within that directory (i.e. I'm not being silly and running it somewhere else)

@maximehardy
Copy link

Maybe the docs were not up to date when you created this issue, but here is the solution for the missing aliases dev, watch...:

Add the following into your package.json

"scripts": {
    "dev-server": "encore dev-server",
    "dev": "encore dev",
    "watch": "encore dev --watch",
    "build": "encore production --progress"
}

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

2 participants