philipwalton / html-inspector

HTML Inspector is a code quality tool to help you and your team write better markup. It's written in JavaScript and runs in the browser, so testing your HTML has never been easier.
2.32k stars 145 forks source link

ReferenceError: Can't find variable: HTMLInspector #41

Closed philipwalton closed 10 years ago

philipwalton commented 10 years ago

Clone https://github.com/djforth/image-replace.git and run htmlinspector index.html and you'll see the above error.

ReferenceError: Can't find variable: HTMLInspector
philipwalton commented 10 years ago

@adrianstainforth In your specific case it seems to be because index.html is loading RequireJS, and that is conflicting with Browserify's UMD shim.

Browserify detects that AMD is happening on the page, so it doesn't expose the HTMLInspector object on window (since it assumes you'll be requiring it somewhere). I'll have to think about whether I want to support this case.

adrianstainforth commented 10 years ago

Ahhh, ok, well give me a good excuse to learn Browserify! Well thanks for looking into it :)

philipwalton commented 10 years ago

I wouldn't necessarily change what you're doing. HTML Inspector should be able to handle this case. I just need to think of the best way.

That being said, Browserify is a cool tool. I recommend learning it.

philipwalton commented 10 years ago

This should be fixed as of v0.8.0. If you're still having problems let me know.

djforth commented 10 years ago

Awesome, thank you that works perfectly :)

That said enjoying playing with Browserify!