Skip to content

Problem with setting basepath #456

Closed
@kaizencodes

Description

@kaizencodes

Hi,
I'm trying to use alloy editor with react through npm, based on https://github.com/ipeychev/alloyeditor-react-component
To the package.json I've added : "alloyeditor": "^0.7.3"
run npm install

in application.js which is loaded in every page i have:

window['CKEDITOR_BASEPATH'] = "alloyeditor/";
window['ALLOYEDITOR_BASEPATH'] = "alloyeditor/";

I have a react component at: project_folder/app/assets/javascripts/components/inputs/textarea.js:

var AlloyEditor = require('alloyeditor');
...

  componentDidMount: function() {
    this._editor = AlloyEditor.editable(this.props.id);
  },

...
When I instantiate a textarea I get the error :
TypeError: c[a] is undefined
a));var c=this;d=function(){c[a].dir=c.rtl[a]?"rtl":"ltr";b(a,c[a])};this[a]?d()..

The basepath is not set correctly. The path is set, I've checked in the browser, yet ckeditor fails to load. I tried setting it in numerous ways with no results. What I understood, is that in the example project the path is set to the dist folder, which in my case is set in node_modules/alloyeditor/dist/alloy-editor/ that didn't help either.
What could be the problem? Any help would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions