ankit / stylebot

Change the appearance of the web instantly
https://stylebot.dev/
MIT License
1.4k stars 208 forks source link

Require.js conflict [Bug] #570

Closed iamsolarplexus closed 4 years ago

iamsolarplexus commented 4 years ago

Our software uses require.js, and it appears yours does as well. Since the update, we have seen an unexpected error in the console which is due to multiple instances of require.js trying to run our code.

Sadly, I can't help you repro the problem or give too many proprietary details about our code. Basically, we use a data-main attribute for our require.js script tag that runs a file to modify the require-base stuff. See here for more about that: https://requirejs.org/docs/api.html#data-main Now that's happening twice and the second time incorrectly since it's running it as a relative path, tacking that main js file to the end of the url.

So perhaps the solution is for us to change our software to have more specificity about which require.js to use. But if you could contain the scope of your require.js a bit, as it was before (or is the addition of requirejs new?) that'd be ideal. I don't think we'll change soon, so I might just have to find another CSS extension if you can't change it.

To repro, create a little local site using the data-main attribute and see if it conflicts.

ankit commented 4 years ago

@iamsolarplexus thanks for reporting. I was redundantly injecting the requirejs script without the stylebot editor being activated. I am hoping this will resolve the issue. I will let you know when the release is published on the chrome webstore so you can help me test this out.

iamsolarplexus commented 4 years ago

I'm so glad it's an evident issue with a potential fix on the way. Thanks for your responsiveness. The recent changes to the UI look really good, btw.

I'll look forward to testing out the next release when you advise.

ankit commented 4 years ago

@iamsolarplexus this should now be resolved in the latest update. Feel free to reopen this issue, if it isn't

iamsolarplexus commented 4 years ago

Confirmed. Thanks for fixing!