tajo / nextjs-baseweb

Slightly opinionated scaffold of Next.js and Base Web.
52 stars 11 forks source link

Not working with next 13 #9

Closed pencilcheck closed 1 year ago

pencilcheck commented 1 year ago
Error: "MyDocument.getInitialProps()" should resolve to an object with a "html" prop set with a valid html string
    at loadDocumentInitialProps (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/render.js:693:23)
    at async renderDocument (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/render.js:738:39)
    at async Object.renderToHTML (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/render.js:775:28)
    at async doRender (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/base-server.js:810:34)
    at async cacheEntry1.responseCache.get.incrementalCache.incrementalCache (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/base-server.js:931:28)
    at async /Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/response-cache/index.js:83:36
Error: "MyDocument.getInitialProps()" should resolve to an object with a "html" prop set with a valid html string
    at loadDocumentInitialProps (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/render.js:693:23)
    at async renderDocument (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/render.js:738:39)
    at async Object.renderToHTML (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/render.js:775:28)
    at async doRender (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/base-server.js:810:34)
    at async cacheEntry1.responseCache.get.incrementalCache.incrementalCache (/Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/base-server.js:931:28)
    at async /Users/penn/Projects/umf-ume-new/node_modules/.pnpm/next@13.2.4_biqbaboplfbrettd7655fr4n2y/node_modules/next/dist/server/response-cache/index.js:83:36
pencilcheck commented 1 year ago

There is a working example at vercel/nextjs but that is only vanilla styletron, it stops working when including baseui due to hydration error which I don't know how to fix

irving-caamal commented 1 year ago

try to remove node_modules and lock files, I sent this PR, and is working as expected, I also updated the main class-based components to FC.