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

Error: window.datalayer is not defined #207

Closed
DinerIsmail opened this issue Mar 8, 2018 · 3 comments
Closed

Error: window.datalayer is not defined #207

DinerIsmail opened this issue Mar 8, 2018 · 3 comments

Comments

@DinerIsmail
Copy link

I have just updated to Webpack 4, and I am getting an error like in the above screenshot. I am using Redux Beacon right as in the documentation. Do you have any idea what the problem could be? Thanks!

image

@ttmarek
Copy link
Contributor

ttmarek commented Mar 8, 2018

Hey @DinerIsmail.

It looks like you're missing the dataLayer function on the window object. Have you included the Google Tag Manager snippet in your index.html file as described here?

@DinerIsmail
Copy link
Author

Thanks for replying @ttmarek! I have done that, but it still doesn't work. It has actually worked fine with Webpack 3, just after I updated to Webpack 4 it stopped working. Therefore it might be an issue with Webpack 4 itself, but just wanted to make sure. If you hear of any related issues please let me know :)

@ttmarek
Copy link
Contributor

ttmarek commented Mar 11, 2018

Ah...It could be that the html-webpack-plugin is giving you issues. They didn't support webpack 4 right away. It looks like they might have pushed a new release out: jantimon/html-webpack-plugin#860.

@ttmarek ttmarek closed this as completed Apr 1, 2018
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

2 participants