Update flash.js to fix:DeprecationWarning: The util.isArray API is deprecated. Please use Array.isArray() instead. - #57
Conversation
Fix: DeprecationWarning: The `util.isArray` API is deprecated. Please use `Array.isArray()` instead.
Since modifying files in node_modules will be overwritten when you run npm install, use patch-package to persist these changes.
1. npm install patch-package postinstall-postinstall
2. Modify flash.js
3. npx patch-package connect-flash
4. Add the following script to your package.json to ensure the patch is applied after each npm install:
"scripts": {
"postinstall": "patch-package"
}
|
Hi @penn201500 I came across this PR after encountering the same error. I also noticed my changes get overwritten whenever i run npm install. My question is if the source code for this package was changed to use Array.isArray() instead, would the patch still be needed? Why is the proposed solution to add a patch to change the source instead of changing the source directly? Sorry if this is a noob question, I am learning |
Hi, @Chorwhat. Suppose the source code for this package fixed the warning. The patch is not needed anymore. |
Fix: DeprecationWarning: The
util.isArrayAPI is deprecated. Please useArray.isArray()instead.Since modifying files in node_modules will be overwritten when you run npm install, use patch-package to persist these changes.
"postinstall": "patch-package"
}