-
-
Notifications
You must be signed in to change notification settings - Fork 104
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
M not defined ... #604
Comments
Hi @VukIgor , could you provide a more detailed errors or a link where we can reproduce the issue? Thanks. edit: can try using latest version (v2.2.1) and see if the issues still persists. |
At the moment im using 2.1.1 on few websites. When 2.2.0 is called via link from cdn whole css on site is gone and in console is m is not defined ,materialize modules are called via m.autoinit . however 2.2.0 works on site that is running node js .Did not try 2.2.1, will do tonight . Maybe that 2.2.0 is one of |
https://materializeweb.com/toasts.html "Show Toast" button does not work. Console shows "Uncaught ReferenceError: M is not defined" |
Hi @VukIgor, sorry I just remembered about this issue. I also encountered it when I was upgrading from v2.0.4 to v2.2.0 in my own projects. I couldn't remember the details but I remembered that before this the Old implementation: M.toast({text: "I am a toast"}); New implementation: new M.Toast({text: "I am a toast"}); It seems like we need to initialize our own M variables before using it. I am not sure if it by design is like that but since you said that in NodeJS environment works well, this might be a valid bug report. But still requires further investigation. Hi @uscss-nostromo, thanks for reporting as well the documentation issue. There was an issue with the documentation that hasn't been updated to reflect the previous refactor. I will tag with bug and documentation for this issue for others to investigate. |
Version 2.2.0 does not work for normal developers that need to include css into existing sites ,works with node due to possibility of importing M from materialize ,not so for direct css linking .
If this version is not for normal usage you should say so, not let devs to run for errors everywhere when 2.2.0 is linked to website
The text was updated successfully, but these errors were encountered: