Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ace error when using ember ace in an addon #35

Open
cptran777 opened this issue Apr 9, 2019 · 2 comments
Open

Ace error when using ember ace in an addon #35

cptran777 opened this issue Apr 9, 2019 · 2 comments

Comments

@cptran777
Copy link

Hey folks,

Wanted to bring this potential bug to someone's attention. Trying to use ember-ace as part of an addon right now, and receiving this error when I try to test it out in the dummy app in ember s:

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

Settings being used right now are:

// index.js
module.exports = {
  name: require('./package').name,
  options: {
    ace: {
      modes: ['json'],
      workers: ['json'],
      exts: ['searchbox']
    }
  }
};

and in the template:

{{ember-ace
  readOnly=isReadOnly
  update=(action "onJsonUpdate")
  class="dataset-compliance__editor"
  value=myjson
  enableAutocompletion=true
  enableLiveAutocompletion=true
  minLines=10
  maxLines=50
  showLineNumbers=true
  useWrapMode=true
  mode="ace/mode/json"
  worker="ace/mode/json_worker"
  theme="ace/theme/github"
}}

Another issue that may be related is:

Uncaught DOMException: Failed to execute 'importScripts' on 'WorkerGlobalScope': The script at 'http://localhost:9007/worker-json.js' failed to load.
    at blob:http://localhost:9007/a491165c-9f7d-4ce5-adda-40b87025626d:1:1

Seems like it can't load the worker on localhost in this situation?

Discovered this issue when migrating some code from an existing application where everything works fine to an addon. Been trying to figure out what the issue is, and would appreciate any insight on this. Thanks!

@JamesWilmot
Copy link

Hi @cptran777,
Just wondering if you had any luck with this?

@kliput
Copy link

kliput commented Sep 8, 2020

@cptran777 @JamesWilmot I've got similiar error message, but in the application built with Ember 2.18 (also when serving with ember s). I ended with adding relative workerPath option to ember-cli-build:

    'ace': {
      workerPath: './assets/ace',
    },

--- EDIT ---
Maybe you could just set any workerPath, because the message says that it could not get the worker path.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants