Webpack-encore: Managed item controllers.js isn't a directory or doesn't contain a package.json

Created on 28 Jan 2021  路  9Comments  路  Source: symfony/webpack-encore

Hello,

I have a problem when I install Encore on a new Symfony project in 5.2.2

symfony new project --full
composer req encore
npm install --force
npm run dev

When I build, I have this message:

 DONE  Compiled successfully in 1407ms                                                                                                                                                              2:10:06 PM

 I  5 files written to public/build
Entrypoint app [big] 382 KiB = runtime.js 15 KiB vendors-node_modules_symfony_autoimport_js-node_modules_symfony_stimulus-bridge_dist_index_js-369183.js 355 KiB app.css 390 bytes app.js 12.3 KiB

LOG from webpack.FileSystemInfo
<w> Managed item /Users/Romain/Code/Project/node_modules/@symfony/autoimport.js isn't a directory or doesn't contain a package.json
<w> Managed item /Users/Romain/Code/Project/node_modules/@symfony/controllers.js isn't a directory or doesn't contain a package.json
+ 13 hidden lines

But on a running project I don't have this problem, this problem is only present when I create a new Symfony project.
It's normal?

Most helpful comment

Hi @Crayzo!

Yes, you can ignore this for now. It will be fixed when we release @symfony/stimulus-brige 2.0 :). I will leave this open until then.

Cheers!

All 9 comments

I think it might be related to the fact that https://github.com/symfony/recipes/pull/883 has not been merged yet.

Hi @Crayzo!

Yes, you can ignore this for now. It will be fixed when we release @symfony/stimulus-brige 2.0 :). I will leave this open until then.

Cheers!

Thanks @stof @weaverryan I'm waiting for the issue to be closed :)

@weaverryan shouldn't this be released as @symfony/stimulus-brige 2.0 as it breaks BC ?

@stof @symfony/stimulus-bridge is experimental. So... we can really do either.

Well, previous versions of the EncoreBundle recipe were adding a ^ constraint for it in the package.json, which relies on the fact that the package follows semver. As upgrading to the new version of the bridge also require changing project files (to remove the old auto-import), we should rather make that explicit by making them change their package.json to 2.0 instead of silently upgrading to a BC-breaking version and letting them figure out a weird error message.

we should rather make that explicit by making them change their package.json to 2.0 instead of silently upgrading to a BC-breaking version and letting them figure out a weird error message

That's a good argument to me: when they opt into going to 2.0, it would be much easier for them to debug

Hello, i have a problem when i install symfony/webpack on a symfony project version 5.2

Entrypoint app [big] 382 KiB = runtime.js 15 KiB vendors-node_modules_symfony_autoimport_js-node_modules_symfony_stimulus-bridge_dist_index_js-369183.js 355 KiB app.css 390 bytes app.js 12.2 KiB

LOG from webpack.FileSystemInfo
Managed item /home/ander/symfony5/node_modules/@symfony/autoimport.js isn't a directory or doesn't contain a package.json
Managed item /home/ander/symfony5/node_modules/@symfony/controllers.js isn't a directory or doesn't contain a package.json

  • 13 hidden lines

Hi @Mbogning!

Yes, you have the same issue described here. Try upgrading to @symfony/stimulus-bridge 2.0. The warning is harmless, but it goes away in that version.

Cheers!

Was this page helpful?
0 / 5 - 0 ratings