草庐IT

build-types

全部标签

javascript - npm run build 失败并显示 "Error: custom keyword definition is invalid: data.errors should be boolean"

当我尝试构建VueJS应用程序时,我发现npm出错。我在GitLabCI的build阶段看到这个错误。我找不到任何关于错误消息的提及。我以前能够成功运行npmrunbuild并且我没有对Vue应用程序代码进行任何更改,所以我不确定是什么导致了这个错误。-Buildingforproduction...ERRORError:customkeyworddefinitionisinvalid:data.errorsshouldbebooleanError:customkeyworddefinitionisinvalid:data.errorsshouldbebooleanatAjv.addK

javascript - 使用: and => for the return type with a TypeScript function?有什么区别

我有以下代码:///functionaddThemePrototypes(){vartemplateSetup=newArray();$.fn.addTemplateSetup=function(func,prioritary){if(prioritary){templateSetup.unshift(func);}else{templateSetup.push(func);}};}有人能告诉我为什么要用=>void来声明吗?interfaceJQuery{addTemplateSetup:(func:Function,priority:bool)=>void;}我想我对如何从java

javascript - 执行 Action 时 redux 出错 : Uncaught type error: cannot read property 'type' of undefined

刚刚接触React。我想这是一个基本问题,但我不明白为什么reducer没有被解雇或更新状态:我的HomeView.js:....const{localeChange,counter,locale}=this.propsreturn(increment(7)}>Increment.....)constmapStateToProps=(state)=>({locale:state.locale,counter:state.counter})exportdefaultconnect(mapStateToProps,{localeChange,increment})(HomeView)我的r

javascript - 未捕获的类型错误 : Failed to execute 'observe' on 'MutationObserver' : parameter 1 is not of type 'Node'

所以我下面的代码在jsfiddle中独立运行。但出于某种奇怪的原因..在将它推送到实时服务器后,我一直收到此错误:/我无法弄清楚为什么......错误:mycodewitherror.js:23UncaughtTypeError:Failedtoexecute'observe'on'MutationObserver':parameter1isnotoftype'Node'.js:$(document).ready(function(){//Thebelowcollectsuserloginname,newlogindateandtime,andprevioususeURLvarelem

javascript - 类型错误 : Failed to set the 'buffer' property on 'AudioBufferSourceNode' : The provided value is not of type 'AudioBuffer

我正在处理现有的codoCircle.调低音量。它按预期运行。现在我想在codepen中使用相同的代码我得到这个错误类型错误:无法在“AudioBufferSourceNode”上设置“缓冲区”属性:提供的值不是“AudioBuffer”类型我做了一些研究,找到了firstanswer有用。答案是当我在playSoundplayer.buffer=buffer中分配时,缓冲区仍未定义,因为加载回调尚未触发。这对我来说很有意义,所以我尝试做一个setTimeout像:setTimeout(playSound,9000);没有成功。你知道解决这个问题的方法吗?为什么在CodeCircle中

javascript - Webpack babel-loader runtime : Module build failed: TypeError: this. setDynamic 不是函数

我正在尝试将babel-loader与babel-plugin-transform-runtime一起使用。我已按照以下说明进行操作:https://github.com/babel/babel-loader#babel-is-injecting-helpers-into-each-file-and-bloating-my-code相关代码:rules:[//the'transform-runtime'plugintellsbabeltorequiretheruntime//insteadofinliningit.{test:/\.js$/,exclude:/(node_modules

javascript - 在 input[type=file] 上使用 click() 时出现问题

click()函数有问题。它在Opera中不起作用。我正在尝试使inputtype=fileclickedon另一个元素的onclick事件。我需要设置我的输入type=file元素的样式,因此我将其设置为不可见,并将其替换为简单样式的按钮。现在我希望在单击按钮时单击文件元素。我不能使用jQuery,因为我在我的页面中使用MooTools库作为日历,当我尝试使用jQuery时它会产生冲突。我也尝试使用jQuery.noConflict();来避免冲突,但我做不到,因为我是jQuery的新手。这是我的html代码:这是我的JavaScript代码:functionshow_upload(

javascript - CSS3 选择器 [*|type ="toc"]

我正在使用EPUB.JS,它使用以下代码从ePub文件中获取一些信息:varnavEl=navHtml.querySelector('nav[*|type="toc"]')这行代码在IE10中失败,因为querySelector返回null。我以前从未见过格式为[*|attr="val"]的属性选择器,但我认为他们想说的是,“选择所有具有任何属性或名为“type”且值为“toc”的属性的导航元素。”我找不到关于这种星形管道语法的任何信息,但我认为它是某种在Webkit/Mozilla中有效但在IE中无效的逻辑OR命令。将该行更改为:varnavEl=navHtml.querySelec

javascript - 我应该对我的/src 文件还是/build 文件进行单元测试?

在设置单元测试时(在我的例子中,使用JasmineforJavaScript)是否应该测试未缩小/未丑化的src文件?还是应该测试最终用户build文件(缩小和丑化)?在我的grunt配置中:jasmine:{src:['src/file.js']}对比jasmine:{src:['build/file.min.js']}一方面,测试src文件很好,因为它不会删除调试器,并且在需要时更容易检查。另一方面,我可以尽可能多地测试src文件,但最终用户将运行的内容并不真实,因为build文件被丑化和缩小。 最佳答案 您绝对应该对编写的裸源

javascript - Angular 5 : ng build - -prod fails due to clean-css: Cannot read property 'line' of undefined

我的应用在Angular5.2.6下。ngserve一切正常,但是当运行ngbuild--prod时,它需要一段时间,然后才会失败。这些错误似乎与clean-css操作有关。错误跟踪:92%chunkassetoptimization/home/khalidvm/Desktop/Workspace/Front/frontend_v2/node_modules/clean-css/lib/reader/input-source-map-tracker.js:37if(originalPosition.line===null&&line>1&&selectorFallbacks>0){^T