-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Webpacker can't find pack in test environment #1047
Comments
@sdellis You would need to precompile assets for test environment before running circle ci (in one of the steps). |
steps:
run: NODE_ENV=test bundle exec rails webpacker:compile |
Thanks for the help. When I do that I get this compilation error using webpack-dev-server 2.9.4 :
I can try playing with different versions of webpack-dev-server to try to get this to work. |
How does your
|
@gauravtiwari I was having trouble setting up my test environment for Jest, but I can't remember exactly what the issues were since it was a while ago. I remember that I had to customize the test environment following instructions here to get it working. However, I've recently upgraded Webpacker and now find that the defaults work. Closing out this non-issue. Thanks again for your help! |
@gauravtiwari Sorry for blowing you up today. I have another question that I would like some clarification on. After making the following upgrades Webpacker: I started receiving the above error on CircleCI. I was able to fix it by adding a manual step to compile webpack like above (e.g. |
@codebycliff In node world,
In this PR #1359, I have made
The above will load test env configuration from webpacker.yml but will compile packs in production mode. So you can remove any explicit For example: circle:
<<: *default
# Setting this compiles packs on the first request, I guess this is why you didn't have to compile before?
compile: true
# Compile test packs to a separate directory
public_output_path: packs-circle Does this make sense? |
Yes it does. Thank you for your detailed response. Removing the |
Just to add that |
Thanks @jsugarman for the pointer. After running asset pre-compilation it still did not work for me, but pointed me (finally) to my root cause:
I have a global |
What is the point of the |
@dmolesUC I did not need the pre-compilation but it showed me the error that the binstubs were not there. Adding the binstubs to git fixed it |
It works like a charm, but this is painful when run the test, it waste lot of time. |
I'm getting this error on my CircleCI test server (but not when I run tests locally):
I have the following set in my
webpacker.yml
:and
The directory structure is a little unconventional as the Rails devs I'm working with are separating out potentially sharable pieces of the app via the valhalla directory. The structure looks like this:
I am confused as to why I don't get this error in my local test environment and only on CircleCI.
The text was updated successfully, but these errors were encountered: