Open TiagoBlauth opened 1 year ago
did you solve the problem? I got a similar issue. my error message is this
Error: sheet not found
at eval (index.esm.js:70150:23)
at (app-pages-browser)/node_modules/@fortune-sheet/core/dist/index.esm.js (http://localhost:3000/_next/static/chunks/app/%5Blng%5D/Dashboard/page.js:455:1)
at options.factory (webpack.js:718:31)
at __webpack_require__ (webpack.js:39:33)
at fn (webpack.js:373:21)
at eval (index.esm.js:5:77)
at (app-pages-browser)/node_modules/@fortune-sheet/react/dist/index.esm.js (http://localhost:3000/_next/static/chunks/app/%5Blng%5D/Dashboard/page.js:708:1)
at options.factory (webpack.js:718:31)
at __webpack_require__ (webpack.js:39:33)
at fn (webpack.js:373:21)
at eval (page.tsx:27:79)
at (app-pages-browser)/src/app/[lng]/Dashboard/page.tsx (http://localhost:3000/_next/static/chunks/app/%5Blng%5D/Dashboard/page.js:1602:1)
at options.factory (webpack.js:718:31)
at __webpack_require__ (webpack.js:39:33)
at Function.fn (webpack.js:373:21)
I must have missed this issue since it's quite old, I will have a look this week
For my case, I solved the problem in the following way.
Next.js App router 13.5.4 typescript babel ~ 7.24.7
<div css={workBook}>
<Workbook data={ref.current?.getSheet() ? [ref.current.getSheet()] : [{ name: "Sheet1" }]} ref={ref}/>
</div>
import { useRouter } from "next/navigation";
const router = useRouter();
...
<FileButton text="수정하기" onClick={() => router.push("/Dashboard/edit")} />
...
const handleSave = () => {
if (ref.current) {
const celldataArray = ref.current.getSheet() as any;
postSchedule(
{ constrId, formData: celldataArray },
{
onSuccess: () => router.push("/Dashboard"),
},
);
}
};
The error occur when I click the save button and router.push("/Dashboard") is called.
I changed "router.push" to window.location.href.
<FileButton text="수정하기" onClick={() => (window.location.href = "/Dashboard/edit")} />
...
onSuccess: () => (window.location.href = "/Dashboard"),
I don't know why this works. If someone knows the reason, please comment.
I think the hard reload is getting rid of any indeterminate states which might be causing this issue. Need to have a deeper look.
Describe the bug I am trying to recreate a sheet by removing current sheets, adding new sheets, and populating the cells. So far so good, the sheet remove and recreate works, value set works, but when I try to set cell formats it presents the error below.
To Reproduce Steps to reproduce the behavior:
Sheet reloading process, this is the failing process.
Cell format function
Not relevant, but it is here, the saving process for local storage
The workbook itself:
The error happens when
getAllSheets()
process runs andcellFormat()
is called. If I takecellFormat()
out ofgetAllSheets()
and use separate buttons, both works.Expected behavior I expect to be able to format the sheet in the same process I am creating the sheets.
Additional context I tried to use CommonOptions to determine the sheet I am referring to, but I am probably doing it wrong. Try to find an example in the documentation or in here with no luck. It would be nice if you can provide me an example.