You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I ran into a minor problem when using the provided gulpfile.js.
nick@Nick-PC:~/nickchen120235.github.io/assets$ gulp post -n 'hello world'
[10:46:56] Using gulpfile ~/nickchen120235.github.io/assets/gulpfile.js
[10:46:56] Starting 'post'...
[10:46:56] 'post' errored after 19 ms
[10:46:56] TypeError: title.replaceAll is not a function
at /home/nick/nickchen120235.github.io/assets/gulpfile.js:22:71
at post (/home/nick/nickchen120235.github.io/assets/node_modules/undertaker/lib/set-task.js:13:15)
at bound (domain.js:416:15)
at runBound (domain.js:427:12)
at asyncRunner (/home/nick/nickchen120235.github.io/assets/node_modules/async-done/index.js:55:18)
at processTicksAndRejections (internal/process/task_queues.js:77:11)
My setup is the following:
OS: Ubuntu 20.04 5.10.16.3-microsoft-standard-WSL2 on WSL2, Windows 10 build 10.0.19042.1110
node version (node -v): 14.17.4
npm version (npm -v): 6.14.14
The problem is that String.prototype.replaceAll() is introduced in ES2021 and my node somehow doesn't support the spec.
The fix is replacing title.replaceAll(' ', '-') with title.replace(/ /g, '-') and I think the change will make the script more robust.
The text was updated successfully, but these errors were encountered:
nickchen120235
changed the title
Use String.prototype.replace instead of String.prototype.replaceAll
Use String.prototype.replace instead of String.prototype.replaceAll (PR ready)
Aug 4, 2021
Thanks for this awesome project!
I ran into a minor problem when using the provided
gulpfile.js
.My setup is the following:
5.10.16.3-microsoft-standard-WSL2
on WSL2, Windows 10 build 10.0.19042.1110node
version (node -v
): 14.17.4npm
version (npm -v
): 6.14.14The problem is that
String.prototype.replaceAll()
is introduced in ES2021 and my node somehow doesn't support the spec.The fix is replacing
title.replaceAll(' ', '-')
withtitle.replace(/ /g, '-')
and I think the change will make the script more robust.The text was updated successfully, but these errors were encountered: