-
Notifications
You must be signed in to change notification settings - Fork 142
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
stencil push fails with error "worker initialization failed" #1236
Comments
I'm getting this error too, however my config is named |
Having the same issue. @stefanmiodrag @pvaladez were you able to fix it and if so, how? |
@stefanmiodrag @travisfisher-pdi you can either update to the latest |
@travisfisher-pdi Has anybody figured this out? I am also receiving this error. I just installed the latest version of stencil cli. also my file is config.stencil.json @pvaladez |
@ldias2025 @stefanmiodrag I joined the BigCommerce Developers Slack channel and did a search and everyone's feedback on the issue was to upgrade your theme version (in our case, this was the Capacity theme). I diffed the new version of the theme against our older version and brought over our customizations to the newest version (in this case, 5.0.0) and that solved the issue. I do recommend joining that Slack group if you have not done so yet. A lot of good activity there. |
@travisfisher-pdi thank you for the response. That is unfortunate. There is so much custom code and changes to the website I would be terrified to update it and try to see what all needs brought over. |
I deleted my original complaining session to update that I was able to come up with a solution. I now realize if I would have looked at the OP a little closer, I would have resolved this much sooner. The issue was simply that stencil.conf.cjs is being renamed and/or deleted from the project at some point. Once I replace this file, everything builds as expected. |
Are you on cornerstone theme? Where did you find the stencil.conf.cjs or stencil.conf.js file, because I cant find this anywhere. All I see is my config.stencil.json |
@justsilencia So I looked at one of my old themes and I found the stenicl.conf.js was completely missing from my current theme , I added it back in. I am hoping this solves the problem. |
@ldias2025 I am having the same issue. Glad to see there are others in my boat! Can you please advise where the stencil.conf.js should be and what it should contain? Thank you |
Its always nice to hear that others are experiencing the same thing and its not just me being dumb! Haha. So the theme I was trying to push and rendered the worker initialization error did not have the stencil.conf.js file in it at all. I am not sure why. But it needs to just go in the root directory - so the same spot as other files like secrets.stencil.json, schema.json, config.json, etc. And actually when I added the stencil.conf.js ONLY and tried to do stencil start... stencil wouldnt even start. Now that I have added the stencil.conf.cjs it will load stencil AND push through. I actually have both files sitting in my root directory at the moment. As far as what it contains I am not sure. You should be able to snag it from the original theme and just place it in the root directory of the theme you are wanting to work on and push to the site. I hope this helps! |
I just copied this file for my cornerstone theme and the stencil bundle worked! |
Same! So happy! I hate when my Stencil messes up. Its always such a pain to figure out. Haha |
@ldias2025 @serchrobles Thank you to all for your help - this did it! I can't believe it was so simple.
|
This I am not sure of. I didnt even notice I have that too until you brought it up, but everything seems to be functioning okay so I am rolling with it at the moment. |
Great this worked for me. |
I came across this problem this morning. Here is what happens:
TLDR: when you do a "stencil download" of your current theme into a "new" local directory, stencil.conf.js is NOT included. Downloaded one from the base cornerstone theme github account. dropped in folder and viola, good to go. |
Expected behavior
stencil push
works. Or an easier to see and more informative error is shown.Actual behavior
stencil push
fails with the errorworker initialization failed
.Steps to reproduce behavior
Using
stencil-cli
version 8.4.0, as soon as you runstencil start
it renamesstencil.conf.js
tostencil.conf.cjs
. Afterward, if someone else using an olderstencil-cli
version like7.5.5
thenstencil push
fails with a very subtle error that just saysworker initialization failed
.I realize that this could be avoided by just making sure that everyone is using the latest version, but some of us developers are a paranoid folk who often try not to update things unless we have to. Additionally, it might not be obvious what caused this failure to happen.
Could we do something to handle this situation better? Perhaps:
.cjs
file extension.cjs
extension... I figure this is done because of the recent move to esm, but is it necessary?stencil-cli
should be compatible with the theme code. You could perhaps use this information to provide a better error in the future.a. On that note, the current version of cornerstone doesn't use the
.cjs
extension.Also, I realize I'm getting a bit picky in asking for the above, but I figure it couldn't hurt to maybe consider it. Also, half the reason for writing this is for anyone else that may encounter the problem and not realize what's going on.
Environment
Stencil-cli version
stencil --version
:8.4.4 / 7.5.5
Node version
node -v
:18.19
NPM version
npm -v
:10.2.3
OS:
macOS
The text was updated successfully, but these errors were encountered: