Hi @anujmakhloga,
Thanks for contacting us, I hope that you had a nice weekend. Let me know which widget and the code you are using on your sidebar, and I can suggest some solutions.
A reminder from previous conversation, AMP does not allow custom JavaScript, at least in the traditional way. Let’s say you want to display non-amp ads on a non-amp: page it is fine. The script will run normally in a non-AMP, at the AMP version the script tag will be removed, and a warning will be triggered, but you mark as solved, because this is an expected behavior. And for the AMP version, you use your AMP compatible ads plugin.
Warnings are different from errors, warning the script will be removed, and your page continues valid.
But in the case you need to use this script in AMP version. You’ll need to find an alternative to using custom JS.
Three options:
– Use an AMP component that implements the desired functionality.
Develop an alternative that works with JS turned off. While the AMP plugin removes custom JS it will at the same time unwrap noscript tags, so if you have fallback behavior for when JS is turned off in the browser, then this will become the baseline AMP experience.
– Refactor your JS to be containable in amp-script.
– Serve the functionality in an iframe via amp-iframe.