Tag: firebase webpack

在使用Google Closure Compiler,webpack和Firebase JS SDK编译js时出现JSC_NON_GLOBAL_DEFINE_INIT_ERROR

使用下面的工具编译js时会出现JSC_NON_GLOBAL_DEFINE_INIT_ERROR: webpack:3.5.6 Google Closure Compiler JS:20170806.0.0 Firebase JS SDK:4.3.1 环境 MacOS X:10.11.6 node.js:v7.10.0 npm:4.2.0 这是错误消息: ERROR in app.bundle.js:5325 (JSC_NON_GLOBAL_DEFINE_INIT_ERROR) @define variable assignment must be global 与webpack.config.js如下所示: module.exports = { plugins: [ new ClosureCompiler({ options: { languageIn: 'ECMASCRIPT6', languageOut: 'ECMASCRIPT3', compilationLevel: 'SIMPLE_OPTIMIZATIONS', warningLevel: 'QUIET' } }) ] 这个错误是由于@define / utils / constants.js中的@define注解引起的。 var CONSTANTS = exports.CONSTANTS […]

没有被调用的外部JS文件的function

我正在使用webpack和firebase。 我有我的package.json> "start": "webpack-dev-server ./index.js",这一行"start": "webpack-dev-server ./index.js", 在我的index.js文件中我有函数 logUserIn(){ //does stuff }; 在我的index.html文件中,我有这一行> <input type="submit" onclick=logUserIn() value="Log in"> 当我点击那个button,我得到这个错误> Uncaught ReferenceError: logUserIn is not defined 我的index.html文件> <script src="bundle.js"></script>中也有这一行,它应该链接到包含index.js的包文件是否正确? 最后,我在index.js中写了一个console.log,内容是console.log('hello') ,当我刷新页面时,出现hello,这意味着index.html通过bundle.js调用index.js为什么地球上不会识别我的方法名? 这绝对不是因为我已经复制和粘贴错字

带有节点和Webpack的Firebase无法正常工作 – 无法读取未定义的属性“导航器”

我收到以下错误: /Users/…/express/server/bundle.js:296 License: https://www.firebase.com/terms/terms-of-service.html */(function(){var h,n=this;function p(a){return void 0!==a;}function aa(){}function ba(a){a.wb=function(){return a.wf?a.wf:a.wf=new a();};}function ca(a){var b=typeof a==="undefined"?"undefined":_typeof(a);if("object"==b){if(a){if(a instanceof Array)return "array";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if("[object Window]"==c)return "object";if("[object Array]"==c||"number"==typeof a.length&&"undefined"!=typeof a.splice&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("splice"))return "array";if("[object Function]"==c||"undefined"!=typeof a.call&&"undefined"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable("call"))return "function";}else return "null";}else if("function"==b&&"undefined"==typeof a.call)return "object";return b;}function da(a){return "array"==ca(a);}function ea(a){var b=ca(a);r TypeError: Cannot read property 'navigator' of undefined at /Users/…/server/bundle.js:296:4904 at Object.<anonymous> […]