javascript - Resolve "Uncaught ReferenceError: require is not defined" error in Node.js -
i trying set basic contact form using senggrid , keep getting "uncaught referenceerror: require not defined" error.
i have code in script tag in head of html page.
var sendgrid = require('sendgrid')(username,pass);
i have looked @ requirejs, not sure why getting error. explain me how can resolve issue?
require()
not built browser.
so when "i have code in script tag in head of html page." explain why symbol require
not defined when script runs. if want use require()
in browser, need first use script tag load library defines require function , supports require()
type functionality , make sure loaded before try use require()
. requirejs 1 such library use.
require()
built node.js on server available there.
Comments
Post a Comment