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

Simply depending on @rails/webpacker isn't enough? Possibly need to add all dependencies to package.json #1537

Closed
swrobel opened this issue May 30, 2018 · 3 comments

Comments

@swrobel
Copy link
Contributor

swrobel commented May 30, 2018

I've had a very confusing conversation with the yarn team on this issue which has led them to indicate that all dependencies that are directly used by a project need to be in package.json, they can't simply be implied by being dependencies of another package in package.json. This particular issue caused babel-loader to not be available to my app after using yarn upgrade.

@rmehner
Copy link
Contributor

rmehner commented May 31, 2018

I've ran into the same thing and did a quick check with npm (5.7.1, not the current one) instead of yarn and there everything worked. But once I use yarn (1.7.0) and upgrade webpacker from 3.2.2 to 3.4.1 (while following the steps described in the README to upgrade), compilation will always fail with ERROR in Entry module not found: Error: Can't resolve 'babel-loader'. Going back to webpacker 3.2.2 everything still works, even with Yarn.

As I'm a bit short on time right now, I didn't investigate further and simply pinned everything to 3.2.2, but something seems to have changed between those versions that Yarn doesn't like. But that's just a hunch :)

@swrobel
Copy link
Contributor Author

swrobel commented Oct 7, 2019

Not sure why this was closed @jakeNiemiec. Yarn is moving towards the PnP system that explicitly prevents accessing dependencies of another package, see https://yarnpkg.com/en/docs/pnp/troubleshooting

@jakeNiemiec
Copy link
Member

Yarn is moving towards the PnP system that explicitly prevents accessing dependencies of another package

@swrobel See the Yarn Plug’n’Play ticket. We can focus there on eliminating the reliance on cross package boundaries in this file:

if Webpacker::VERSION =~ /^[0-9]+\.[0-9]+\.[0-9]+$/
say "Installing all JavaScript dependencies [#{Webpacker::VERSION}]"
run "yarn add @rails/webpacker"
else
say "Installing all JavaScript dependencies [from prerelease rails/webpacker]"
run "yarn add @rails/webpacker@next"
end
say "Installing dev server for live reloading"
run "yarn add --dev webpack-dev-server"

Additionally, webpacker was a very different tool back when this was posted. There have been updates to both the webpacker and node.js sides of the problem. If you want to keep this open, could you post updated info about what packages are still missing in package.json?

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

3 participants