How is your experience with the OutSystems Community?
48
Views
2
Comments
Mismatched anonymous define() module error when navigating to another screen
Question

Just to make sure: I searched every post on the forum related to this problem, but without any clear answer.

We added a GTM script (just the plain script on Google Tag Platform) to our module and tried several implementations of this script to make it work:
- Add script on module level by required scripts section
- Add script on page level by required scripts section 
- Execute script in Layout webblock OnReady and/or OnRender by RequireScript client action
- Execute script by JS code in Layout webblock OnReady and/or OnRender
- Use Forge component 'GoogleTagManagerReactive' and add the HeaderBlock (and/or BodyBlock) with the right ID.
- And much more...

Problem is that when we navigate to a different screen, we get the error 'There was an error processing your request' with in the console the following 'Mismatched anonymous define() module: function (exports) { 'use strict';'

Even with this error and searching on Google I'm not able to find a clear solution what to do and/or how to fix this. Hopefully someone could help us.

Btw, we even tried this with a module with just 2 sample pages and no additional code.




Mismatched anonymous define.png
2025-04-30 18-21-22
Senthil Nathan A

Hi @Jordy van der Jagt ,

  • Don't use RequireScript or OutSystems Required Scripts feature for GTM.

  • Inject GTM directly using raw JavaScript in a Layout block or a Script tag in the Layout or Main screen (eg. OnReady)

Hope this works.

Thanks,

Senthil


UserImage.jpg
Bert Van Bockstael

Hey @Jordy van der Jagt I am facing the same problem. Did you end up finding a solution to this problem?

I already tried using the solution from Sentil nathan A with no avail.

Kr,

Bert

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.