AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

​all pages lost

Open zaoying opened this issue 2 years ago • 12 comments

What happened?

steps

  1. try to export markdown file ran into failure,
  2. then go back to all pages, all pages disappear but error report came up

Version

app.affine.pro

What browsers are you seeing the problem on?

Microsoft Edge

Relevant log output

Unhandled Runtime Error
Error: Integer out of Range

Call Stack
Module.create
javascript\node_modules\lib0\error.js (12:7)
eval
javascript\node_modules\lib0\decoding.js (37:31)
../../node_modules/lib0/decoding.js
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (16984:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (388:21)
eval
webpack-internal:///../../node_modules/lib0/buffer.js (15:70)
../../node_modules/lib0/buffer.js
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (16962:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (388:21)
eval
webpack-internal:///../../node_modules/lib0/encoding.js (39:68)
../../node_modules/lib0/encoding.js
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (17006:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (388:21)
eval
javascript\node_modules\yjs\dist\yjs.cjs (7:15)
../../node_modules/yjs/dist/yjs.cjs
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (15015:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (388:21)
eval
webpack-internal:///../../node_modules/@blocksuite/store/dist/base.js (9:61)
../../node_modules/@blocksuite/store/dist/base.js
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (15917:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (388:21)
eval
webpack-internal:///../../node_modules/@blocksuite/store/dist/index.js (13:66)
../../node_modules/@blocksuite/store/dist/index.js
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (15928:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (388:21)
eval
webpack-internal:///../../packages/workspace/src/affine/login.ts (18:75)
../../packages/workspace/src/affine/login.ts
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (14434:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (388:21)
eval
webpack-internal:///../../packages/workspace/src/affine/api/index.ts (16:64)
../../packages/workspace/src/affine/api/index.ts
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (14379:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (388:21)
eval
webpack-internal:///./src/components/affine/affine-error-eoundary.tsx (10:86)
./src/components/affine/affine-error-eoundary.tsx
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (12289:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)
fn
/_next/static/chunks/webpack.js (388:21)
eval
webpack-internal:///./src/pages/_app.tsx (16:98)
./src/pages/_app.tsx
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/pages/_app.js (13191:1)
options.factory
/_next/static/chunks/webpack.js (733:31)
__webpack_require__
file:///C:/Users/huang/Documents/github/AFFiNE/apps/web/.next/static/chunks/webpack.js (37:33)

Anything else?

No response

Are you willing to submit a PR?

  • [ ] Yes I'd like to help by submitting a PR!

zaoying avatar Apr 12 '23 13:04 zaoying

Export to markdown is a bug in production; I think we will update to the next version in production next week.

The second thing is I didn't see the page lost issue. Could you please share more details?

himself65 avatar Apr 12 '23 14:04 himself65

I have written three pages the workspace before, now it's all gone. http://localhost:8080/workspace/9XbVhCLwON/all

zaoying avatar Apr 12 '23 15:04 zaoying

I cannot access your localhost, I think you can enter F12 and type currentWorkspace.blockSuiteWorkspace.exportYDoc()

himself65 avatar Apr 12 '23 15:04 himself65

nt (WorkspaceDetail) while rendering a different component (BlockSuiteEditorImpl). To locate the bad setState() call inside BlockSuiteEditorImpl, follow the stack trace as described in https://reactjs.org/link/setstate-in-render at BlockSuiteEditorImpl (webpack-internal:///../../packages/component/src/components/block-suite-editor/index.tsx:19:24) at $44d7e150ebc754d2$export$e926676385687eaf (webpack-internal:///../../node_modules/react-error-boundary/dist/react-error-boundary.module.js:30:1) at BlockSuiteEditor (webpack-internal:///../../packages/component/src/components/block-suite-editor/index.tsx:130:19) at LoadableComponent (webpack-internal:///../../node_modules/next/dist/shared/lib/loadable.js:87:9) at PageDetailEditor (webpack-internal:///./src/components/page-detail-editor.tsx:41:11) at PageDetail (webpack-internal:///./src/plugins/local/index.tsx:66:19) at WorkspaceDetail (webpack-internal:///./src/pages/workspace/[workspaceId]/[pageId].tsx:51:74) at WorkspaceDetailPage (webpack-internal:///./src/pages/workspace/[workspaceId]/[pageId].tsx:158:74) at div at eval (webpack-internal:///../../node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js:57:66) at div at eval (webpack-internal:///../../node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js:57:66) at div at eval (webpack-internal:///../../node_modules/@emotion/react/dist/emotion-element-6a883da9.browser.esm.js:57:66) at Provider (webpack-internal:///./src/plugins/local/index.tsx:60:19) at WorkspaceLayoutInner (webpack-internal:///./src/layouts/index.tsx:263:11) at Suspense at NoSsr (webpack-internal:///../../node_modules/@mui/base/NoSsr/NoSsr.js:33:5) at WorkspacesSuspense (webpack-internal:///./src/layouts/index.tsx:155:11) at InnerThemeProvider (webpack-internal:///../../node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js:21:70) at ThemeProvider (webpack-internal:///../../node_modules/@mui/private-theming/ThemeProvider/ThemeProvider.js:43:5) at ThemeProvider (webpack-internal:///../../node_modules/@mui/system/esm/ThemeProvider/ThemeProvider.js:40:5) at ThemeProvider (webpack-internal:///../../packages/component/src/styles/styled.tsx:21:11) at ThemeProviderInner (webpack-internal:///./src/providers/ThemeProvider.tsx:57:11) at f (webpack-internal:///../../node_modules/next-themes/dist/index.module.js:8:597) at $ (webpack-internal:///../../node_modules/next-themes/dist/index.module.js:8:348) at ThemeProvider (webpack-internal:///./src/providers/ThemeProvider.tsx:106:11) at Provider (webpack-internal:///../../node_modules/jotai/esm/react.mjs:20:3) at ProviderComposer (webpack-internal:///./src/components/provider-composer.tsx:9:11) at Suspense at AffineErrorBoundary (webpack-internal:///./src/components/affine/affine-error-eoundary.tsx:140:9) at I18nextProvider (webpack-internal:///../../node_modules/react-i18next/dist/es/I18nextProvider.js:10:19) at App (webpack-internal:///./src/pages/_app.tsx:44:11) at PathnameContextProviderAdapter (webpack-internal:///../../node_modules/next/dist/shared/lib/router/adapters.js:62:11) at ErrorBoundary (webpack-internal:///../../node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js:301:63) at ReactDevOverlay (webpack-internal:///../../node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js:850:919) at Container (webpack-internal:///../../node_modules/next/dist/client/index.js:62:1) at AppContainer (webpack-internal:///../../node_modules/next/dist/client/index.js:172:11) at Root (webpack-internal:///../../node_modules/next/dist/client/index.js:347:11) window.console.error @ next-dev.js:20

zaoying avatar Apr 12 '23 15:04 zaoying

could you see the same issue on https://dev.affine.live/ ?

himself65 avatar Apr 12 '23 19:04 himself65

No. the issue is different.

Error #421; visit https://reactjs.org/docs/error-decoder.html?invariant=421 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at framework-d6b15d8b3dd1dcdb.js:9:78089
    at ub (framework-d6b15d8b3dd1dcdb.js:9:78363)
    at i (framework-d6b15d8b3dd1dcdb.js:9:121363)
    at oO (framework-d6b15d8b3dd1dcdb.js:9:99113)
    at framework-d6b15d8b3dd1dcdb.js:9:98980
    at oF (framework-d6b15d8b3dd1dcdb.js:9:98987)
    at oS (framework-d6b15d8b3dd1dcdb.js:9:94026)
    at x (framework-d6b15d8b3dd1dcdb.js:33:1373)
    at MessagePort.T (framework-d6b15d8b3dd1dcdb.js:33:1903)
_app-30d62ea702a2c64e.js:29 
create TQdkM4Hvce Array(1)

zaoying avatar Apr 13 '23 04:04 zaoying

No. the issue is different.

Error #421; visit https://reactjs.org/docs/error-decoder.html?invariant=421 for the full message or use the non-minified dev environment for full errors and additional helpful warnings.
    at framework-d6b15d8b3dd1dcdb.js:9:78089
    at ub (framework-d6b15d8b3dd1dcdb.js:9:78363)
    at i (framework-d6b15d8b3dd1dcdb.js:9:121363)
    at oO (framework-d6b15d8b3dd1dcdb.js:9:99113)
    at framework-d6b15d8b3dd1dcdb.js:9:98980
    at oF (framework-d6b15d8b3dd1dcdb.js:9:98987)
    at oS (framework-d6b15d8b3dd1dcdb.js:9:94026)
    at x (framework-d6b15d8b3dd1dcdb.js:33:1373)
    at MessagePort.T (framework-d6b15d8b3dd1dcdb.js:33:1903)
_app-30d62ea702a2c64e.js:29 
create TQdkM4Hvce Array(1)

Fixed in https://github.com/toeverything/AFFiNE/commit/6180a4c3cb324e8d0ca3f01007f914693d739282

himself65 avatar Apr 13 '23 06:04 himself65

the issue still came up the same error in local workspace. local storage shows "recentViews"

{"9XbVhCLwON":[{"id":"GUSi_nYmpo","mode":"page"},{"id":"jJEOXbti5n","mode":"page"},{"id":"ICDoWE05_X","mode":"page"}],"ao1h_b7kPe":[{"id":"KddwgFnrVG","mode":"page"},{"id":"9d0DPm0sUr","mode":"page"}]}

zaoying avatar Apr 13 '23 06:04 zaoying

did AFFine supports data backup?My three pages are lost, how could I get them back ?

zaoying avatar Apr 13 '23 06:04 zaoying

What's your edge browser version?

himself65 avatar Apr 13 '23 19:04 himself65

You can run the following code in the F12 console

currentWorkspace.blockSuiteWorkspace.exportYDoc()

And a binary file will be downloaded

himself65 avatar Apr 13 '23 20:04 himself65

What's your edge browser version?

Microsoft Edge 112.0.1722.39 64 bit

zaoying avatar Apr 14 '23 02:04 zaoying