When rendering Univer Sheet in Next.js, the error "Cannot find 'univer.doc.text-selection-render-manager' registered by any injector." occurs. #2441
-
I want to render UniverSheet in Next.js. However, when selecting a cell on the sheet, the following error appears:
The initial setup is defined within a component, which is then imported in app/page.tsx. In the component's useEffect, plugins are defined as follows: if (!containerRef.current) {
throw Error("container not initialized");
}
const univer = new Univer({
theme: defaultTheme,
locale: LocaleType.EN_US,
locales: {
[LocaleType.EN_US]: Tools.deepMerge(
SheetsEnUS,
DocsUIEnUS,
SheetsUIEnUS,
UIEnUS,
DesignEnUS,
SheetsNumfmtEnUS
),
},
});
univer.registerPlugin(UniverRenderEnginePlugin);
univer.registerPlugin(UniverFormulaEnginePlugin);
univer.registerPlugin(UniverUIPlugin, {
container: containerRef.current,
header: true,
footer: true,
});
univer.registerPlugin(UniverSheetsPlugin);
univer.registerPlugin(UniverSheetsUIPlugin);
univer.registerPlugin(UniverDocsPlugin, {
hasScroll: false,
});
univer.registerPlugin(UniverDocsUIPlugin);
univer.registerPlugin(UniverSheetsNumfmtPlugin);
univer.registerPlugin(UniverSheetsFormulaPlugin);
// create univer sheet instance
univer.createUnit(UniverInstanceType.UNIVER_SHEET, data); The data looks like this: const [data] = useState({
appVersion: "3.0.0-alpha",
id: "bs-sheet",
locale: "enUS",
name: "bs-sheet",
sheets: {
"bs-sheet": {
id: "bs-sheet",
name: "B/S",
cellData: {},
// other properties
},
},
}); I don't understand why this error occurs. Please let me know if you have any concerns or suggestions. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
Adding Sorry for the trouble. |
Beta Was this translation helpful? Give feedback.
-
I ask what is better support? |
Beta Was this translation helpful? Give feedback.
-
Ok , what is the best for work ?
Mayra delapaz
…On Mon, Jul 29, 2024 at 2:00 AM Maxth47 ***@***.***> wrote:
unfortunately, this lib has very small community and support.
—
Reply to this email directly, view it on GitHub
<#2441 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BCOM4O5FJZ3U7OLSKIPWLDDZOXLAXAVCNFSM6AAAAABI5Y47QGVHI2DSMVQWIX3LMV43URDJONRXK43TNFXW4Q3PNVWWK3TUHMYTAMJXGU4TIOI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
Adding
containerRef.current = univer;
fixed the bug.
Sorry for the trouble.