Multiple warnings: Could not load worker TypeError: e.split is not a function
See original GitHub issuePlease how can I mute the multiple warning messages in the console. I assume the setMode
ivocation is the direct cause of it. How should I rephrase my code so that is goes silent? Below please find my code.
console.(anonymous function) @ console.js:26
o @ VM41567:1
$startWorker @ VM41567:1
$onChangeMode @ VM41567:1
setMode @ VM41567:1
AceEditorComponent.setMode @ component.ts:82
AceEditorComponent.init @ component.ts:35
AceEditorComponent @ component.ts:28
Wrapper_AceEditorComponent @ wrapper.ngfactory.js:7
View_ContentPageComponent0.createInternal @ component.ngfactory.js:210
AppView.create @ view.js:74
DebugAppView.create @ view.js:327
View_ContentPageComponent_Host0.createInternal @ host.ngfactory.js:16
AppView.createHostView @ view.js:81
DebugAppView.createHostView @ view.js:338
ComponentFactory.create @ component_factory.js:154
ViewContainerRef_.createComponent @ view_container_ref.js:113
RouterOutlet.activate @ router_outlet.js:98
ActivateRoutes.placeComponentIntoOutlet @ router.js:899
ActivateRoutes.activateRoutes @ router.js:873
(anonymous function) @ router.js:828
ActivateRoutes.activateChildRoutes @ router.js:828
ActivateRoutes.activateRoutes @ router.js:860
(anonymous function) @ router.js:828
ActivateRoutes.activateChildRoutes @ router.js:828
...
for brevity: snipped repetitive calls from Observable and zone
html
<ace-editor #editor
class="code-editor"
mode="html"
theme="clouds"
[text]="(buildHtml$ | async)"
[readOnly]="!(editorInitialized$ | async)"
[autoUpdateContent]="false"
(textChanged)="onCodeChange($event)"
></ace-editor>
ts
private editorOptions: any = {
showPrintMargin: false,
showInvisibles: true,
highlightGutterLine: false,
highlightActiveLine: false,
fadeFoldWidgets: true,
showLineNumbers: true,
showGutter: true,
fontSize: 16,
wrap: false,
};
const editor = this.editor.getEditor();
editor.$blockScrolling = Infinity; // needed to suppress component's debug message
editor.setOptions(this.editorOptions);
Issue Analytics
- State:
- Created 7 years ago
- Comments:15
Top Results From Across the Web
TypeError: u.split is not a function - javascript - Stack Overflow
You're passing messages as an array, not as a string. Change your code to db.collection("groups").doc(groupId).collection("messages").add({ ...
Read more >TypeError: split is not a function in JavaScript | bobbyhadz
The "split is not a function" error occurs when we call the split() method on a value that is not of type string....
Read more >JavaScript Errors and How to Fix Them - David Walsh Blog
JavaScript can be a nightmare to debug: Some errors it gives can be very difficult to ... Uncaught TypeError: undefined is not a...
Read more >Firebase JavaScript SDK Release Notes - Google
Cloud Firestore. Fixed a bug that caused Uncaught TypeError: e.auth.addAuthTokenListener is not a function . See GitHub ...
Read more >Fixed - Uncaught TypeError: a.replace is not a function
appBadgeUpdate() . This does assume that newCount is a string, but this might not necessarily be the case - on initial page load...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
This is working for me:
Maybe some info in the README would be useful. I didn’t even know this was using brace until @Jinnie’s comment. Thanks.
you don’t need to add
"../node_modules/ace-builds/src-min/ace.js"
to your scripts array in angular-cli.json. If it’s there take it out.
add this to the top of your ace-editor component.ts
plus
for every theme and mode you want.
Then make your
export class
look something like this:the element should be rendered and watched by brace without any errors
NOTE:
For some reason brace won’t detect the
<ace-editor #editor></ace-editor>
directive as it stands in your comment. You have to change it to<div ace-editor id="editor"></div>
ALSO !
make sure you are not importing
import { AceEditorModule } from 'ng2-ace-editor';
in your app.module.ts as it will overwrite brace and not allow you to set the mode or other options