ChatALL
ChatALL copied to clipboard
migrate ChatMessage to composition API SFC
migrate ChatMessage to composition API SFC
Thank you for contribution. However, the code contains many warnings like:
[Vue warn]: injection "Matomo" not found.
at <ChatMessage key=173 columns=2 message= {t
......
And errors when click hide button:
Uncaught TypeError: Cannot read properties of undefined (reading 'trackEvent')
at hide (ChatMessage.vue:103:1)
at eval (runtime-dom.esm-bundler.js:358:1)
at callWithErrorHandling (runtime-core.esm-bundler.js:173:1)
at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:182:1)
at callWithAsyncErrorHandling (runtime-core.esm-bundler.js:192:1)
at HTMLButtonElement.invoker (runtime-dom.esm-bundler.js:345:1)
Indeed, the problem comes from vue-matomo which loads asyncronously the script not making the intance and injection of Matomo available.
Edit: this PR#75 should be solve it
https://github.com/AmazingDreams/vue-matomo/blob/3e4c8000c9117beccff7a6712082de25dc13fca7/src/index.js#LL184C4-L184C4
I looks that the commit was not rebased with the HEAD well?
I have identified the source of the problem.
Your commit was not up to date with the upstream/main branch. You used git merge
to combine the commits from upstream/main, but this altered the signatures of some commits. This would make the main commit history messy if I git merge
your branch.
You should have used git rebase
instead, which would preserve the commit history in a neat way.
Now, since your branch has diverged, neither git merge
nor git rebase
will work. I did some research and found a possible solution.
- Use
git log
and note down the hash values of the commits you made. - Create a fresh branch based on the latest upstream main branch and switch to it.
- Use
git cherry-pick HASH_OF_YOUR_COMMIT
to apply your commits one by one. There may be conflicts. Follow the instructions fromgit cherry-pick
to resolve them. - If you have more than one commit and know how to amend, squash them into one commit.
- Make a new pull request based on the new branch.
It is a bit complicated, but it should work. Next time, always use git rebase
to keep up with the upstream repo.
Thank you.