Skip to content

Update flash.js to fix:DeprecationWarning: The util.isArray API is deprecated. Please use Array.isArray() instead. - #57

Open
penn201500 wants to merge 1 commit into
jaredhanson:masterfrom
penn201500:master
Open

Update flash.js to fix:DeprecationWarning: The util.isArray API is deprecated. Please use Array.isArray() instead.#57
penn201500 wants to merge 1 commit into
jaredhanson:masterfrom
penn201500:master

Conversation

@penn201500

Copy link
Copy Markdown

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"
    }

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"
}
@Chorwhat

Copy link
Copy Markdown

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

@penn201500

Copy link
Copy Markdown
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants