Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migration hompage's next.js code to 13+ version #122

Draft
wants to merge 35 commits into
base: main
Choose a base branch
from

Conversation

DongjaJ
Copy link
Contributor

@DongjaJ DongjaJ commented Apr 10, 2024

What this PR does / why we need it?

migration hompage's next.js code to 13+ version(page >> app)

Any background context you want to provide?

What are the relevant tickets?

Fixes #96

Checklist

  • Added relevant tests or not required
  • Didn't break anything

@DongjaJ DongjaJ marked this pull request as ready for review April 10, 2024 14:06
@hackerwins hackerwins self-requested a review April 11, 2024 09:13
Copy link
Member

@hackerwins hackerwins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution.

While looking at the PR, I had two questions.

A. An error occurs when opening /docs

The /docs page could not be accessed. Can you possibly find the cause?

1 of 1 unhandled error
Server Error
Error: Page "/docs/[[...slug]]/page" is missing exported function > "generateStaticParams()", which is required with "output: export" config.

This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
DevServer.renderToResponseWithComponentsImpl
file:///Users/hackerwins/Development/yorkie-team/yorkie-team.github.io/node_modules/next/dist/server/base-server.js (959:27)

B. Invalid next.config.js options detected when running npm run dev

It looks like some options have been changed or removed. Could you look into the cause?

⚠ Invalid next.config.js options detected:
⚠ Expected string, received number at "env.nextImageExportOptimizer_quality"
⚠ Expected string, received boolean at "env.nextImageExportOptimizer_storePicturesInWEBP"
⚠ Expected string, received boolean at "env.nextImageExportOptimizer_generateAndUseBlurImages"

@DongjaJ
Copy link
Contributor Author

DongjaJ commented Apr 11, 2024

A. The bug is not reproduced in my development environment. Can you explain it in detail?
I found that bug. I'll try this

B.
This occurs in next.js 13.5 and later versions.
In next.config.js file, next.config.env's type is Record<string,string>. But the current setting of the project is not

// next.config.js
/** @type {import('next').NextConfig} */
const nextConfig = {
   ...
  env: {
    nextImageExportOptimizer_imageFolderPath: 'public/assets/images',
    nextImageExportOptimizer_exportFolderPath: 'out',
    nextImageExportOptimizer_quality: 75,
    nextImageExportOptimizer_storePicturesInWEBP: true,
    nextImageExportOptimizer_generateAndUseBlurImages: true,
    NEXT_PUBLIC_BUILT_AT: new Date().toUTCString(),
  },
  ...
    return config;
  },
};

module.exports = nextConfig;

So I changed next.config.js.

@DongjaJ DongjaJ marked this pull request as draft April 11, 2024 11:43
@DongjaJ
Copy link
Contributor Author

DongjaJ commented Apr 15, 2024

I solve bug A. That is because of the dynamic parameters option. So I removed that options.

vercel/next.js#56477
vercel/next.js#56253

But I found another bug.

An error occurs when opening /docs/sample

/docs/sample/sample-nested, /docs/sample/sample-nested2 path is OK. but only /docs/sample path occurs error.

Unhandled Runtime Error
Error: Cannot access ContentWrapper.propTypes on the server. You cannot dot into a client module from a server component. You can only pass the imported name through.

I think It related this issue.
vercel/next.js#56153
hashicorp/next-mdx-remote#405

So I'm solving this bug now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[suggestion] migration hompage's next.js code to 13+ version
2 participants