D
D
dhat2016-12-23 19:25:04
JavaScript
dhat, 2016-12-23 19:25:04

Why does the script throw an error when it does not work with a CDN?

I use generator-webapp and include the gumshoe.js script. Throws errors:

Uncaught TypeError: Cannot read property 'window' of undefined

Uncaught ReferenceError: gumshoe is not defined
I placed the script tag in different places - both in the head, and at the beginning of the body and at the end. DOES NOT WORK.
When I connect the script via CDN, everything works.
When I just make static files, everything works.
I'm running through Gulp in generator-webapp - it doesn't work, bastard. What is it?))

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dhat, 2016-12-23
@dhat

Understood. In this scaffold, you need to use Bower for vendor scripts.

A
Arman, 2016-12-23
@Arik

window is a browser object, if you do not launch it in a browser, then it is not there

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question