-
Notifications
You must be signed in to change notification settings - Fork 147
std/esm stopped working with pm2 cli options #157
Comments
Hi @dnalborczyk!
Update: |
Hey @jdalton , thank you for looking into this. I'm just about to get done with work. I'll update the above repo now to use pm2. I also tried to debug and come up with a shorter repro (w/o pm2) - with no success. :/ edit: didn't see you forked it already, let me check it out ... |
Heads up 👷 , I just force pushed an update to the fork. |
On a side note: Update: |
geeez, you're quick. it's hard to catch up. :D do you think the above fix is responsible for the pm2 non-load -- or unrelated? I can pull down master and check... |
I wasn't able to reproduce a problem with |
oh, gotcha. it only appears that it is working. just wanted to mention: for production we're pre-compiling with Babel (except modules), and then just require everything afterwards with std/esm. I haven't tried the combination --require std/esm and --require babel with pm2. for some reason this script didn't work for me:
but I shortened it to:
or, alternatively, from the cli:
the above modified script appears to work, as one can see the online status. though when you run:
afterwards, the status changed to errored. you can access the error log on the provided path in the cli-output of show under error log path. btw, for a minute it did appear to run, but it was after I ran your start script, and then the above (modified) pm script:
the start script created the caching files, and then for some reason std/esm is able to read the cached values with the pm script. if you delete the caching folder, and run the pm script (in my case the modified version), pm2 doesn't start. I just saw that you created v0.16.1. I can give it a try and see if it fixes it. otherwise I can also update your fork? |
Feel free to update the fork... I'll make you an admin of it. I haven't published the release so there's still time to dig into things. |
cool, thanks a bunch @jdalton !! I gotta run to a birthday party, but I'll update the fork with some instructions soon afterwards! btw: I was about to suggest to move the .esm-cache into the node_modules/.cache folder, as babel, nyc, and others do. But when I wanted to write it up, the next version of std/esm had it changed already :D |
Hmm interesting. I'm digging in. Update: Update Update: Update Update Update: |
just run the latest from master 1649402 and std/esm seems to work with pm2!! -- including in conjunction with babel!! I made sure I tested with a clean plate: deleted .cache, pm2 kill etc. do you still want me to update your fork? it's essentially just something like the following:
|
Rock 🤘 !
No, I have it working now 😋 |
it seems that v0.17.2 unfortunately broke the usage with pm2 again :/ v0.17.1 seems to work. would you rather have a new bug filed in cases like that? I can also bisect and try to find the responsible commit if you like? I'm also unsure if that is something which would needed to be fixed on the pm2's side of things ...? |
Sorry about that @dnalborczyk! With 0.17.2 I added scenario tests for |
cool, thanks!! let me know if I can be of any help ... |
@dnalborczyk I found the issue. I'll have a patch, scenario test, and bump a release today. |
saweeeet!!! thanks a bunch!! |
we are using std/esm on a production deployment with docker and pm2 (https://github.com/Unitech/pm2). for some reason, std/esm stopped working with pm2 with version 0.14.0+ for both (fork and cluster mode), version 0.13.0 works just fine.
repro steps:
it throws an following exception:
it seems that std/esm itself is being loaded, as it seem to value the cache directory -- if it has been created prior, with a different approach, see below.
interestingly, 0.14.0+ still works when started with:
The text was updated successfully, but these errors were encountered: