partytown
partytown copied to clipboard
TypeError: document.getElementsByTagName(...).item is not a function with ChatPlus script
Description:
The third-party script for ChatPlus is throwing a TypeError: document.getElementsByTagName(...).item is not a function error when executed within Partytown. This issue prevents ChatPlus from functioning correctly when Partytown is enabled.
nuxtjs/partytown Version:
$ yarn list --pattern @nuxtjs/partytown
└─ @nuxtjs/[email protected]
Code Snippet (nuxt.config.ts):
export default defineNuxtConfig({
modules: ["@nuxtjs/partytown"],
partytown: {
debug: true
},
app: {
head: {
script: [
{
src: "https://app.chatplus.jp/cp.js",
async: true,
type: "text/partytown",
body: true,
},
],
},
},
});
Current behavior:
The script is embedded as follows
<script async type="text/partytown" src="https://app.chatplus.jp/cp.js" data-pterror="TypeError: document.getElementsByTagName(...).item is not a function...."></script>
This is the error message that is output
The problem here is that when insert DOM into the application via GTM, the DOM is not displayed. Is there a way to disable Partytown for individual tools in GTM?