unjs/changelogen

config.templates.commitMessage.replaceAll is not a function with node 14

selimdoyranli opened this issue · 7 comments

Environment

v14.18.0

Reproduction

Describe the bug

When I run the 'yarn changelogen --release' command i get the error mentioned in the title. I don't have any problem when my Node version is 16.0.0, but when it's 14.18.0, I get the error. I think it's because replaceAll function started to be used in version 15.0.0. Can you create alternative for replaceAll fn due to solve it?

Additional context

node_error

Logs

No response

pi0 commented

Hi. Node.js 14 is getting EOL very soon. Why you need to stay with it?

hello pooya, my project has very old dependencies that are only compatible with this version of Node. Maybe it's time to refactor the project to upgrade it, you're right 😂. I just asked because if it's an easy task and it could be helpful for me, I thought I would request it. If it's an easy task, I would like you to please solve it. If not, you can close this issue. thank you for the quick action and your help

pi0 commented

Making polyfill or replacing with regex is not that hard. Was mainly curious what are those old deps?

I have no idea, but I think it's incompatible because the project couldn't be started. I've been trying nvm 18.0.0 for the last hour and getting the error in the screenshot. I thought it was an incompatibility issue because I didn't get this error with version 14. However, I just that I set the nvm version to 16.18.0 and both my nuxt@2.16.0 project and changelogen are working now

log

pi0 commented

Ohh it is webpack issue. @danielroe fixed it with a smart trick on latest Nuxt 2 release if you are using it.

Regardless let's keep this issue open we can probably avoid replaceAll easily.

it has been resolved with version nuxt@2.16.3 for node version 18.0.0 and works changelogen. thank you for your patience 😅🙏

This issue seems to be already resolved and can be closed.