giscafer / ngx-ace-tern

Tern plugin for Ace Editor for Angular
http://giscafer.github.io/ngx-ace-tern/
MIT License
8 stars 1 forks source link

Error when initializing ace-editor #1

Open keremcankabadayi opened 4 years ago

keremcankabadayi commented 4 years ago

Hi there, I have some error issue but nothing affects it.

Here my code:

<div
                      id="eca-editor"
                      ace-editor
                      [text]="bodyInput"
                      [mode]="mode"
                      [theme]="theme"
                      [options]="options"
                      [readOnly]="false"
                      (textChanged)="onBodyChange($event)"
                    ></div>
 "scripts": [
              "node_modules/jquery/dist/jquery.min.js",
              "node_modules/bootstrap/dist/js/bootstrap.min.js",
              "node_modules/alertifyjs/build/alertify.min.js",
              "node_modules/ace-builds/src-min/ace.js",
              "node_modules/ace-builds/src-min/theme-monokai.js",
              "node_modules/ace-builds/src-min/mode-javascript.js",
              "node_modules/ace-builds/src-min/mode-json.js",
              { "bundleName": "worker-json", "input": "node_modules/ace-builds/src-min/worker-json.js" }
            ]

Unable to infer path to ace from script src, use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes or with webpack use ace/webpack-resolver

ace.js:1 GET http://localhost:4200/ext-tern.js net::ERR_ABORTED 404 (Not Found)

image

I checked my node_modules folter to load this script but i didnt found like ext-tern.js

Any idea how to avoid this error?

giscafer commented 4 years ago

@keremcankabadayi trying use brace instead ? see: https://github.com/giscafer/ledge/blob/c139b889af63c213d62a1a320becd1f751ff6faa/src/app/presentation/ledge-helper/ledge-helper.component.ts#L8


This page is use the ngx-ace-tern https://devops.phodal.com/helper

keremcankabadayi commented 4 years ago

I got rid of the error,

Unable to infer path to ace from script src, use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes or with webpack use ace/webpack-resolver

but I'm still getting this error,

index.js:3802 GET http://localhost:4200/ext-tern.js net::ERR_ABORTED 404 (Not Found)

I added like this,

import 'brace/index';
import 'brace/theme/monokai';
import 'brace/mode/json';
keremcankabadayi commented 4 years ago

And also below warning came up. Here is solution of this. How can i fix it?

Automatically scrolling cursor into view after selection change this will be disabled in the next version set editor.$blockScrolling = Infinity to disable this message

giscafer commented 4 years ago

And also below warning came up. Here is solution of this. How can i fix it?

Automatically scrolling cursor into view after selection change this will be disabled in the next version set editor.$blockScrolling = Infinity to disable this message

try get the editorRef by (editorRef)="editorRef($event)"

https://github.com/giscafer/ngx-ace-tern/blob/4fd2f322ecfa46fb0dd9d2f53c80c2d89904aa89/demo/src/app/app.component.ts#L30

this.acEditor.$blockScrolling = Infinity
giscafer commented 4 years ago

@keremcankabadayi

index.js:3802 GET http://localhost:4200/ext-tern.js net::ERR_ABORTED 404 (Not Found)

Can you reproduce this error by giving a demo on codesandbox or stackblitz?