Bootstrap won't compile css SyntaxError: Cannot read property 'toCSS' - javascript

I am using Google App engine and Bootstrap 3 with an Ubuntu local environment. When I try to load a page the browser returns this error which I think is essentially saying less.js can't compile the .css file. Pre-compiled bootstrap is not used in my system as I pull in parts in our less and work from there. This error appears 10% of the time.
SyntaxError: Cannot read property 'toCSS' of null
in admin-bootstrap-theme.less
at http://127.0.0.1:8080/js/less.js:7952:30
at http://127.0.0.1:8080/js/less.js:7860:13
at callback.type (http://127.0.0.1:8080/js/less.js:7809:13)
at handleResponse (http://127.0.0.1:8080/js/less.js:7734:13)
at doXHR (http://127.0.0.1:8080/js/less.js:7754:9)
at loadFile (http://127.0.0.1:8080/js/less.js:7803:5)
at loadStyleSheet (http://127.0.0.1:8080/js/less.js:7827:5)
at loadStyleSheets (http://127.0.0.1:8080/js/less.js:7867:9)
at Object.less.refresh (http://127.0.0.1:8080/js/less.js:7944:5)
at http://127.0.0.1:8080/js/less.js:7970:6
Similarly, this error appears along side the first.
SyntaxError: Cannot read property 'toCSS' of null
in admin-bootstrap.less
at http://127.0.0.1:8080/js/less.js:7952:30
at http://127.0.0.1:8080/js/less.js:7860:13
at callback.type (http://127.0.0.1:8080/js/less.js:7809:13)
at handleResponse (http://127.0.0.1:8080/js/less.js:7734:13)
at doXHR (http://127.0.0.1:8080/js/less.js:7754:9)
at loadFile (http://127.0.0.1:8080/js/less.js:7803:5)
at loadStyleSheet (http://127.0.0.1:8080/js/less.js:7827:5)
at loadStyleSheets (http://127.0.0.1:8080/js/less.js:7867:9)
at Object.less.refresh (http://127.0.0.1:8080/js/less.js:7944:5)
at http://127.0.0.1:8080/js/less.js:7970:6
Finally, the more confusing part and also common part is this error which is much more common, without much of a stacktrace.
NameError: .box-shadow is undefined
in theme.less on line 28, column 3:
27 #shadow: inset 0 1px 0 rgba(255,255,255,.15), 0 1px 1px rgba(0,0,0,.075);
28 .box-shadow(#shadow);
29
So I have tried reinstalling all my files with proper permissions. I recently updated python. I tried saving the files without a BOM as discussed in another post. Any help would be much appreciated.

I found the answer when my coworker and I were double checking our dependencies. Turns out that the version of less.js was very low 1.7.3. When we upgraded the compiler to 2.5.3 the compilation succeeded and everything was a success.

Related

react-monaco-editor blackout... TypeError: Cannot read property 'pushUndoStop' of undefined

I use "react-monaco-editor" for my project.
import { MonacoDiffEditor } from 'react-monaco-editor';
...
<MonacoDiffEditor
width="1140"
height="520"
language="javascript"
theme="vs-dark"
original={this.props.original}
value={this.props.current}
options={{
renderSideBySide: true,
}}
editorDidMount={this.editorDidMount}
/>
This error can only be viewed after deploy my server.
simpleWorker.js:25 Could not create web worker(s). Falling back to
loading web worker code in main thread, which might cause UI freezes.
Please see https://github.com/microsoft/monaco-editor#faq el #
simpleWorker.js:25 simpleWorker.js:28 You must define a function
MonacoEnvironment.getWorkerUrl or MonacoEnvironment.getWorker el #
simpleWorker.js:28 react-dom.production.min.js:5058 TypeError: Cannot
read property 'pushUndoStop' of undefined
at l.value (diff.js:283)
at ls (react-dom.production.min.js:5163)
at react-dom.production.min.js:6408
at t.unstable_runWithPriority (scheduler.production.min.js:309)
at Ui (react-dom.production.min.js:2816)
at Cl (react-dom.production.min.js:6204)
at cl (react-dom.production.min.js:5895)
at react-dom.production.min.js:2851
at t.unstable_runWithPriority (scheduler.production.min.js:309)
at Ui (react-dom.production.min.js:2816) rs # react-dom.production.min.js:5058
I test in local with nginx, but only serviceWorker warnings logged.
I think that ServiceWorker warnings are http environment in my server.
What is pushUndoStop... I really don't know this error.
help me...
Not sure if you fixed this issue or not by now, since it has been a while, but in case anyone else lands here, I got this issue too. I had v0.20.0 of monaco-editor and v0.35.0 react-monaco-editor which worked fine. Then I updated to v0.23.0 and I ran into this issue as a regression. I then tried v0.25.2 with no change. After that I tried updating react-monaco-editor to the v0.43.0 and the problem stopped happening! I'm thinking it is an issue where they made a change in monaco-editor and if you didn't update react-monaco-editor to a newer version it would break with that error.

Tailwind CSS build error | Acorn unexpected token 26:33

I tried to build tailwindcss on default css but this thing appears....
tailwindcss 2.0.2
? Building from default CSS... (No input file provided)
? SyntaxError: Unexpected token (26:33)
at _class.pp$4.raise (C:\xampp\htdocs\www\css\node_modules\acorn\dist\acorn.
js:2927:15)
at _class.pp.unexpected (C:\xampp\htdocs\www\css\node_modules\acorn\dist\aco
rn.js:698:10)
at _class.pp.expect (C:\xampp\htdocs\www\css\node_modules\acorn\dist\acorn.j
s:692:28)
at _class.pp$3.parseObj (C:\xampp\htdocs\www\css\node_modules\acorn\dist\aco
rn.js:2563:14)
at _class.pp$3.parseExprAtom (C:\xampp\htdocs\www\css\node_modules\acorn\dis
t\acorn.js:2302:19)
at _class.parseExprAtom (C:\xampp\htdocs\www\css\node_modules\acorn-node\lib
\dynamic-import\index.js:77:117)
at _class.pp$3.parseExprSubscripts (C:\xampp\htdocs\www\css\node_modules\aco
rn\dist\acorn.js:2129:21)
at _class.pp$3.parseMaybeUnary (C:\xampp\htdocs\www\css\node_modules\acorn\d
ist\acorn.js:2106:19)
at _class.parseMaybeUnary (C:\xampp\htdocs\www\css\node_modules\acorn-node\l
ib\private-class-elements\index.js:122:54)
at _class.pp$3.parseExprOps (C:\xampp\htdocs\www\css\node_modules\acorn\dist
\acorn.js:2041:21)
I tried reinstalling it but nothing changed... how do i fix this?
After wasting a couple of days, I found that there was a simple typo in my tailwind.config.js
'224': '56rem',
'256': '64rem'.
'304': '76rem',
I suggest checking the line 26 within your own config.
Good luck!

Define local file

This project has to rely on older version of a SAP system. As a result some of the latest features do not work. I would like to have the "minutesStep" property of the latest "TimePicker" version, so I went to the source code and copied the latest TimePicker controls code to our old project.
I am having issues as "TimePicker" relies on the new version of "TimePickersliders" as well. I need to copy its source code as well. However I fail to make the "TimePicker" use the new "TimePickerslider" source code which I copied to the project as well.
sap.ui.define(['jquery.sap.global',
'sap/m/InputBase',
'sap/m/MaskInput',
'sap/m/MaskInputRule',
'sap/m/ResponsivePopover',
'sap/ui/core/EnabledPropagator',
'sap/ui/core/IconPool',
'sap/ui/model/type/Time',
'./TimePickerSliders'], // Here is the problem.
function(jQuery, InputBase, MaskInput, MaskInputRule, ResponsivePopover, EnabledPropagator, IconPool, TimeModel, TimePickerSliders) {
What should be the './TimePickerSliders' path, so that it includes the file in my project? Its in the same folder, but it just fails to pick it up.
Here is the Error I get:
Uncaught (in promise) Error: failed to load 'PROJECT_NAME/controls/MyTimePicker.js' from ./controls/MyTimePicker.js: Error: failed to load 'PROJECT_NAME/controls/Slider.js' from ./controls/Sliders.js: Error: failed to load 'PROJECT_NAME/controls/VisibleItem.js' from ./controls/VisibleItem.js: Error: failed to load 'PROJECT_NAME/controls/library.js' from ./controls/library.js: 404 - NOT FOUND
Is this even possible, reasonable or legal? I seem to be missing some other files as well.
If TimePickerSliders is a .js file located in your controls folder (I assume its on the same level as view and controller folders), try to call it like follows:
sap.ui.define([
...
'<project-namespace>/controls/TimePickerSliders'],
function(jQuery, InputBase, MaskInput, MaskInputRule, ResponsivePopover, EnabledPropagator, IconPool, TimeModel, TimePickerSliders) {

How can I properly add jquery to Eclipse?

I'm importing jquery 1.8.17 js files to Eclipse Indigo, and I have been experiencing some problems. There's several errors in js files, like "missing semicolon", etc.
The problem is that I have to meet up deadlines, and I have to solve this issues ASAP. I suspect that I'm doing something wrong like not just copying the files to WebContent folder and referencing it in the jsp page.
As an example, I'm showing the firs line of the js file where several "missing semicolon" and "syntax error" is occouring:
*/(function(a,b){function d(b){return!a(b).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}function c(b,c){var e=b.nodeName.toLowerCase();if("area"===e){var f=b.parentNode,g=f.name,h;if(!b.href||!g||f.nodeName.toLowerCase()!=="map")return!1;h=a("img[usemap=#"+g+"]")[0];return!!h&&d(h)}return(/input|select|textarea|button|object/.test(e)?!b.disabled:"a"==e?b.href||c:c)&&d(b)}a.ui=a.ui||{};a.ui.version||(a.extend(a.ui,{version:"1.8.17",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}}),a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(b,c){return typeof b=="number"?this.each(function(){var d=this;setTimeout(function(){a(d).focus(),c&&c.call(d)},b)}):this._focus.apply(this,arguments)},scrollParent:function(){var b;a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?b=this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):b=this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!b.length?a(document):b},zIndex:function(c){if(c!==b)return this.css("zIndex",c);if(this.length){var d=a(this[0]),e,f;while(d.length&&d[0]!==document){e=d.css("position");if(e==="absolute"||e==="relative"||e==="fixed"){f=parseInt(d.css("zIndex"),10);if(!isNaN(f)&&f!==0)return f}d=d.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}}),a.each(["Width","Height"],function(c,d){function h(b,c,d,f){a.each(e,function(){c-=parseFloat(a.curCSS(b,"padding"+this,!0))||0,d&&(c-=parseFloat(a.curCSS(b,"border"+this+"Width",!0))||0),f&&(c-=parseFloat(a.curCSS(b,"margin"+this,!0))||0)});return c}var e=d==="Width"?["Left","Right"]:["Top","Bottom"],f=d.toLowerCase(),g={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+d]=function(c){if(c===b)return g["inner"+d].call(this);return this.each(function(){a(this).css(f,h(this,c)+"px")})},a.fn["outer"+d]=function(b,c){if(typeof b!="number")return g["outer"+d].call(this,b);return this.each(function(){a(this).css(f,h(this,b,!0,c)+"px")})}}),a.extend(a.expr[":"],{data:function(b,c,d){return!!a.data(b,d[3])},focusable:function(b){return c(b,!isNaN(a.attr(b,"tabindex")))},tabbable:function(b){var d=a.attr(b,"tabindex"),e=isNaN(d);return(e||d>=0)&&c(b,!e)}}),a(function(){var b=document.body,c=b.appendChild(c=document.createElement("div"));a.extend(c.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0}),a.support.minHeight=c.offsetHeight===100,a.support.selectstart="onselectstart"in c,b.removeChild(c).style.display="none"}),a.extend(a.ui,{plugin:{add:function(b,c,d){var e=a.ui[b].prototype;for(var f in d)e.plugins[f]=e.plugins[f]||[],e.plugins[f].push([c,d[f]])},call:function(a,b,c){var d=a.plugins[b];if(!!d&&!!a.element[0].parentNode)for(var e=0;e<d.length;e++)a.options[d[e][0]]&&d[e][1].apply(a.element,c)}},contains:function(a,b){return document.compareDocumentPosition?a.compareDocumentPosition(b)&16:a!==b&&a.contains(b)},hasScroll:function(b,c){if(a(b).css("overflow")==="hidden")return!1;var d=c&&c==="left"?"scrollLeft":"scrollTop",e=!1;if(b[d]>0)return!0;b[d]=1,e=b[d]>0,b[d]=0;return e},isOverAxis:function(a,b,c){return a>b&&a<b+c},isOver:function(b,c,d,e,f,g){return a.ui.isOverAxis(b,d,f)&&a.ui.isOverAxis(c,e,g)}}))})(jQuery);/*!
Try using the non-minified version of jQuery. At least then the locations of the errors will be legible.
It's available from here.

Grails ui-performance plugin not working with CKEditor

I installed Grails ui-performance plugin and made the necessary changes in the code. It didn't seem to work for development, I was getting files which name was ending with "_vnull" so I disabled it for development and tried to test with a WAR file. However, when generating the WAR file I get the following error and exception:
[ERROR] 1:0:Compilation produced 55 syntax errors. in lineSource: null sourceName: null
ERROR: problem minifying /Users/maricel/.grails/1.3.5/projects/community-services/stage/plugins/ckeditor-3.4.1.1-SNAPSHOT/js/ofm/scripts/languages/ca.js: Compilation produced 55 syntax errors.
org.mozilla.javascript.EvaluatorException: Compilation produced 55 syntax errors.
at com.studentsonly.grails.plugins.uiperformance.JsErrorReporter.runtimeError(JsErrorReporter.groovy:35)
at org.mozilla.javascript.Parser.parse(Parser.java:410)
at org.mozilla.javascript.Parser.parse(Parser.java:355)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.parse(JavaScriptCompressor.java:312)
at com.yahoo.platform.yui.compressor.JavaScriptCompressor.<init>(JavaScriptCompressor.java:533)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper.versionAndMinifyJs(ResourceVersionHelper.groovy:230)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper.this$2$versionAndMinifyJs(ResourceVersionHelper.groovy)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper$this$2$versionAndMinifyJs.callCurrent(Unknown Source)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper.applyVersion(ResourceVersionHelper.groovy:158)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper.this$2$applyVersion(ResourceVersionHelper.groovy)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper$_versionResources_closure1.doCall(ResourceVersionHelper.groovy:101)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper.versionResources(ResourceVersionHelper.groovy:91)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper.this$2$versionResources(ResourceVersionHelper.groovy)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper$this$2$versionResources.callCurrent(Unknown Source)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper.version(ResourceVersionHelper.groovy:44)
at com.studentsonly.grails.plugins.uiperformance.ResourceVersionHelper$version.call(Unknown Source)
at _Events.versionResources(_Events.groovy:36)
at _Events$_run_closure2.doCall(_Events.groovy:16)
at _GrailsEvents_groovy$_run_closure5.doCall(_GrailsEvents_groovy:58)
at _GrailsEvents_groovy$_run_closure5.call(_GrailsEvents_groovy)
at _GrailsWar_groovy$_run_closure5.doCall(_GrailsWar_groovy:327)
at War$_run_closure1.doCall(War.groovy:38)
at gant.Gant$_dispatch_closure5.doCall(Gant.groovy:381)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy:415)
at gant.Gant$_dispatch_closure7.doCall(Gant.groovy)
at gant.Gant.withBuildListeners(Gant.groovy:427)
at gant.Gant.this$2$withBuildListeners(Gant.groovy)
at gant.Gant$this$2$withBuildListeners.callCurrent(Unknown Source)
at gant.Gant.dispatch(Gant.groovy:415)
at gant.Gant.this$2$dispatch(Gant.groovy)
at gant.Gant.invokeMethod(Gant.groovy)
at gant.Gant.executeTargets(Gant.groovy:590)
at gant.Gant.executeTargets(Gant.groovy:589)
Error executing script War: org.mozilla.javascript.EvaluatorException: Compilation produced 55 syntax errors.
Is this some conflict with the CKEditor plugin? Any idea how to fix it?
Thanks for your help!
I fixed this issue by adding an exclusion for the plugins directory:
uiperformance.exclusions = [
"**/plugins/**"
]
As suggested in this nabble post

Categories

Resources