c9 / core

Cloud9 Core - Part of the Cloud9 SDK for Plugin Development https://c9.github.io/core/ https://c9.io
Other
2.56k stars 921 forks source link

Error trying to customize IDE #474

Closed marcoarruda closed 6 years ago

marcoarruda commented 6 years ago

Hello, I'm following this page (https://cloud9-sdk.readme.io/docs/custom-ide-configuration) to customize the IDE for my needs, but I got into this error:

Uncaught TypeError: Cannot read property 'on' of undefined

Basically, I'm just want to remove some plugins I don't need

My custom configuration file is like below:

"use strict";

module.exports = function(options) {

    var config = require("./default-local")(options);

    var includes = [
    ];

    var excludes = {
        "plugins/c9.ide.terminal": true,
        "plugins/c9.ide.terminal/link_handler": true,
        "plugins/c9.ide.terminal/opentermhere": true,
        "plugins/c9.ide.terminal/predict_echo": true,
        "plugins/c9.ide.terminal/terminal": true,
        "plugins/c9.ide.terminal.monitor": true,
        "plugins/c9.ide.terminal.monitor/message_view": true,
        "plugins/c9.ide.terminal.monitor/monitor": true,
        "plugins/c9.ide.run/output": true,
    };

    config = config.concat(includes).map(function(p) {
        if (typeof p == "string")
            p = { packagePath: p };
        return p;
    }).filter(function (p) {
        if (p.packagePath == "plugins/c9.ide.layout.classic/preload") {
            p.defaultTheme = "flat-light"; // set flat theme as default
        }
        else if (p.packagePath == "plugins/c9.core/settings") {
            if (p.settings)
                p.settings.user = {}; // reset user settings
        }
        return !excludes[p.packagePath];
    });

    return config;
};

Does anybody succeed trying to customize it?

Thanks

nightwing commented 6 years ago

Do you use desktop version or the standalone? For standalone you need to use var config = require("./default")(options); instead of default-local. Also where do you get the Uncaught TypeError: Cannot read property 'on' of undefined in node console or in browser?

marcoarruda commented 6 years ago

It was in the web client console and also an alert message.

But I've changed from default-local to default and it worked.

It's solved, many thanks!