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

npm run add-change works only in Node.js 15.x+ #3751

Closed
3 tasks done
trivikr opened this issue May 5, 2021 · 1 comment · Fixed by #3753
Closed
3 tasks done

npm run add-change works only in Node.js 15.x+ #3751

trivikr opened this issue May 5, 2021 · 1 comment · Fixed by #3753
Labels
bug This issue is a bug.

Comments

@trivikr
Copy link
Member

trivikr commented May 5, 2021

Confirm by changing [ ] to [x] below to ensure that it's a bug:

Describe the bug
npm run add-change works only in Node.js 15.x+

Is the issue in the browser/Node.js?
Node.js

If on Node.js, are you running this on AWS Lambda?
No

Details of the browser/Node.js version
v14.16.1

SDK version number
N/A

To Reproduce (observed behavior)
Run npm run add-change in Node.js 14.x

It will error with:

filename.replaceAll is not a function
Exiting...
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! aws-sdk@2.900.0 add-change: `node ./scripts/changelog/add-change.js`
npm ERR! Exit status 1

Expected behavior
npm run add-change succeeds on supported versions of Node.js during development.

@trivikr trivikr added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. and removed needs-triage This issue or PR still needs to be triaged. labels May 5, 2021
@trivikr
Copy link
Member Author

trivikr commented May 5, 2021

This happens because change-creator is using replaceAll while sanitizing fileName.

function sanitizeFileName(filename) {
return filename.replaceAll(/[^a-zA-Z0-9\\.]/g, '-');
}

The support for String.prototype.replaceAll() was added in V8 8.5 which was released with Node.js 15.x: https://nodejs.org/en/blog/release/v15.0.0/#v8-8-6-35415

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant