Open xuyanmei opened 2 years ago
Which version of WebPack are you using?
I think the best option for you right now is to stay on v1.3.0
and wait until you can support modern environment code.
WebPack
Thank you for your answer ,maybe "webpack": "^4.46.0",I thought that the high version might have solved many bugs
Ah yeah, v2.0.0+ is not compatible anymore with WebPack v4 Maybe it is with WebPack v5, but I highly recommend to try out Vite instead
I am having the same problem, how did you solved it?
Same here using these versions...
"@gtm-support/vue-gtm": "^2.0.0" "webpack": "^4.46.0"
Also having this issue.
@juliantn ...
Changing the package.json from:
"@gtm-support/vue2-gtm": "^2.0.0",
to
"@gtm-support/vue2-gtm": "^1.3.0",
got me to a running state.
The solution from @alfreema does not work for me, any ideas ?
@makerovski add "@gtm-support/*" to transpileDepenencies in vue.config.js
I got a solution for this, I use the tracking in a Method
like :
methods: {
sendTracking() {
this.$gtm.trackEvent({
event: "form-submit",
Modell: this.configuration.model.name,
Preis: this.totalPrice,
noninteraction: false
});
},
},
And in main.js
:
import VueGtm from "vue-gtm";
Vue.use(VueGtm, {
id: "GTM-XXXXXX",
defer: false,
enabled: true,
debug: false,
loadScript: true,
trackOnNextTick: false
});
And it worked, maybe helps someone. Thank you!
Same error,
Info
Input
Output or Error
Expected Output
Additional Context
in my nuxt project,npm run in vscode,It seems that the null value merge operator (??) is used。Previous versions using ^ 1.3.0 will not look like this
【error】 You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
@ ./plugins/gtm.ts 2:0-43 6:10-16