adobe-research / theseus

A pretty darn cool JavaScript debugger for Brackets
Other
1.34k stars 69 forks source link

Theseus breaks Polymer #66

Open AdriVanHoudt opened 9 years ago

AdriVanHoudt commented 9 years ago

Since Theseus inserts javascript as first script on the page it breaks the platform.js from Polymer. See "platform.js is not the first script on the page. See http://www.polymer-project.org/docs/start/platform.html#setup for details." I assume Theseus also requires to be the first script otherwise it would be nice to no insert it first or make it optional or something.

alltom commented 9 years ago

Inserting Theseus first is the easiest, most fool-proof way to do it programmatically.

Does it cause problems for Polymer, or does it just trigger a warning?

AdriVanHoudt commented 9 years ago

I guessed so and it triggers the warning and causes problems. Some elements stop working.

alltom commented 9 years ago

Could you give me an example, or will it be obvious if I open a Polymer example project?

AdriVanHoudt commented 9 years ago

It is pretty obvious. With Polymer you include platform.js and it should be the first javascript in the head tag. Like this:

<html>
    <head>
        <script src="/bower_components/platform/platform.js"></script>
    ...
    </head>
    ...
</html>

With Theseus on it looks like

<html>
    <head>
        <script>theseus stuff here</script>
        <script src="/bower_components/platform/platform.js"></script>
    </head>
    ...
</html>

If you look at the Sources tab of Chrome dev tools it displays the Theseus script tag even before the html tag. Also I found that, at least in my version of chrome, it doesn't give the error stated above but it will just give the errors caused by it.