Skip to content
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

Uncaught ReferenceError: pbjs is not defined #267

Closed
dmitriyshashkin opened this issue Mar 24, 2016 · 4 comments
Closed

Uncaught ReferenceError: pbjs is not defined #267

dmitriyshashkin opened this issue Mar 24, 2016 · 4 comments
Assignees

Comments

@dmitriyshashkin
Copy link
Contributor

Easiest way to reproduce - include prebid.js onto the page, while omitting all the inline code.

<script type="text/javascript" src="/build/dev/prebid.js" async></script>

Apparently prebid.js where pbjs object is declared is not the first module to be included into the final build. Yet some of the adapters are trying to add methods to pbjs.

@cwbeck
Copy link

cwbeck commented Mar 24, 2016

We noticed this too in the last couple of builds. Easiest way to avoid is the prepend with:

var pbjs = pbjs || {};
pbjs.que = pbjs.que || [];

We just add this to the top of the prebid lib.

@mkendall07
Copy link
Member

Thanks for pointing this out. Strange because we are already doing this:https://github.com/prebid/Prebid.js/blob/master/src/prebid.js#L4

It's possible that our compile process is moving this line. We'll investigate that.

@protonate
Copy link
Collaborator

Thanks @dmitriyshashkin for reporting the bug, fixed with PR #271.

@protonate
Copy link
Collaborator

Released with 0.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants