elastic / next-eui-starter

Start building Kibana protoypes quickly with the Next.js EUI Starter
https://elastic.github.io/next-eui-starter/
Apache License 2.0
93 stars 30 forks source link

Modules that import @elastic/eui are failing #43

Closed nickythorne closed 2 years ago

nickythorne commented 2 years ago

We use bit.dev to manage common components. These common components have @elastic/eui as a dependency and are built and packaged by webpack. Example build module here:

"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TestComponent = void 0;
const react_1 = __importDefault(require("react"));
const eui_1 = require("@elastic/eui");
function TestComponent({ text }) {
    return (react_1.default.createElement("div", null,
        react_1.default.createElement("p", null, "Test Component"),
        react_1.default.createElement(eui_1.EuiText, null, `EUI: ${text}`)));
}
exports.TestComponent = TestComponent;
//# sourceMappingURL=test-component.js.map

The package has worked great for us up until this point, but unfortunately the webpack config to provide stubs for react-ace doesn't work when the elastic dependency is requested in an imported module.

Any ideas how we can get this to work?