-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
The problem
The remote components loads successfully, however I get the following error in terminal
⚠ ./node_modules/@paciolan/remote-component/dist/getDependencies.js
Module not found: Can't resolve 'remote-component.config.js' in './node_modules/@paciolan/remote-component/dist'
Import trace for requested module:
./node_modules/@paciolan/remote-component/dist/getDependencies.js
./node_modules/@paciolan/remote-component/dist/index.js
More details
The complaining code
var getDependencies = function () {
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
return exports.ensureRemoteComponentConfig(require("remote-component.config.js"));
}
catch (err) {
// istanbul ignore next: This is just too impossible to test
if (!cannotFindModule(err)) {
throw err;
}
return {};
}
};
exports.getDependencies = getDependencies;
//# sourceMappingURL=getDependencies.js.map
This is how I've been using remote-component
import { resolve } from '../../../../../remote-component.config.cjs';
// @ts-expect-error it's cjs code
const requires = createRequires(resolve);
export const useRemoteComponent = createUseRemoteComponent({ requires });
I tried to change cjs
to js
but the warning persists. So I changed it back. And since I've loaded remote-component manually why the code tries to load the config.reoslve again?
Metadata
Metadata
Assignees
Labels
No labels