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

Template tags causing error in compare.js #50

Open
rguttersohn opened this issue Dec 21, 2021 · 0 comments
Open

Template tags causing error in compare.js #50

rguttersohn opened this issue Dec 21, 2021 · 0 comments

Comments

@rguttersohn
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch [email protected] for the project I'm working on.

I am using Petite Vue in a Lauravel Blade file. Like any Vue project, it required me to use to Template tags to handle rendering components. However, the compare.js file in Dom-Compare was emitting an error because it does not account for Document Fragments such as Template tags. I added a line to Switch block to account for document fragments.

See the difference below:

diff --git a/node_modules/dom-compare-temp/lib/compare.js b/node_modules/dom-compare-temp/lib/compare.js
index 73f6361..108850a 100644
--- a/node_modules/dom-compare-temp/lib/compare.js
+++ b/node_modules/dom-compare-temp/lib/compare.js
@@ -111,6 +111,8 @@
                // fallthrough
             case type.CDATA_SECTION_NODE:
                // fallthrough
+            case type.DOCUMENT_FRAGMENT_NODE:
+               // fallthrough
             case type.COMMENT_NODE:
                if (left.nodeType == type.COMMENT_NODE && !this._options.compareComments)
                   return true;

This issue body was partially generated by patch-package.

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

No branches or pull requests

1 participant