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

fix: vercel 배포 시 오류 해결 #36

Merged
merged 18 commits into from
Aug 6, 2024
Merged
Show file tree
Hide file tree
Changes from 15 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/activity/package.json
minsoo-web marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "1.0.0",
"private": true,
"scripts": {
"dev": "next dev --port 3001",
"dev": "next dev -p 3001",
"build": "next build",
"start": "next start",
"start": "next start -p 3001",
"lint": "biome lint ./app",
"format": "biome format ./app --write"
},
Expand Down
8 changes: 4 additions & 4 deletions apps/home/app/@readme/default.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import fs from 'node:fs'
import { promises as fs } from 'node:fs'
Copy link
Member Author

Choose a reason for hiding this comment

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

https://vercel.com/guides/loading-static-file-nextjs-api-route

next.js에서 readFile을 비동기로 하는 것을 안내하고 있어 수정하였습니다.

import path from 'node:path'
import { Readme } from '@/_shared'

export default function Page() {
const filePath = path.join(process.cwd(), 'app/@readme/_shared/content/main.mdx')
const mainReadme = fs.readFileSync(filePath, 'utf8')
export default async function Page() {
const filePath = path.join(process.cwd(), './contents/main.mdx')
const mainReadme = await fs.readFile(filePath, { encoding: 'utf8' })

return <Readme text={mainReadme} />
}
6 changes: 3 additions & 3 deletions apps/home/app/@readme/people/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'node:fs'
import { promises as fs } from 'node:fs'
import path from 'node:path'
import { Readme } from '@/_shared'

Expand All @@ -8,8 +8,8 @@ export default async function Page({
searchParams: { username: string }
}) {
const { username } = searchParams
const filePath = path.join(process.cwd(), 'app/@readme/_shared/content', `${username}.mdx`)
const readme = fs.readFileSync(filePath, 'utf8')
const filePath = path.join(process.cwd(), `./contents/${username}.mdx`)
const readme = await fs.readFile(filePath, { encoding: 'utf8' })

return <Readme text={readme} />
}
3 changes: 3 additions & 0 deletions apps/home/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ const nextConfig = {
experimental: {
typedRoutes: true,
missingSuspenseWithCSRBailout: false,
outputFileTracingIncludes: {
'/people': ['./contents/**/*'],
Copy link
Member Author

@sonsurim sonsurim Aug 6, 2024

Choose a reason for hiding this comment

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

/people 경로에 대해 contents에 있는 모든 파일을 포함하도록 설정하였습니다.

Copy link
Member

Choose a reason for hiding this comment

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

폴더 경로가 변경될 필요도 있는 걸까요? 🤔
image

스크린샷 변경사항이 필요한건지 궁금하다는 질문입니다!

Copy link
Member Author

Choose a reason for hiding this comment

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

#36 (comment)

아고 코멘트가 아래에 남겨졌네요!

0d36b90
에서 �반영 완료!

},
},
webpack(config) {
const fileLoaderRule = config.module.rules.find((rule) => rule.test?.test?.('.svg'))
Expand Down
2 changes: 1 addition & 1 deletion apps/home/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"scripts": {
"dev": "next dev -p 3002",
"build": "next build",
"start": "next start",
"start": "next start -p 3002",
"lint": "biome lint ./app",
"format": "biome format ./app --write"
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"dev:activity": "turbo dev --filter=activity",
"dev:home": "turbo dev --filter=home",
"dev:web": "turbo dev",
"start": "turbo start",
"lint": "turbo lint",
"format": "turbo format",
"prepare": "husky",
Expand Down
5 changes: 5 additions & 0 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
"dev": {
"cache": false,
"persistent": true
},
"start": {
"dependsOn": ["^build"],
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
"dependsOn": ["^build"],
"dependsOn": ["build"],

가 맞지 않나 싶은데, ^ 으로 적으신 이유가 있으신가요?

Copy link
Member Author

Choose a reason for hiding this comment

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

놓쳤어요.! 72ae41a에서 반영 완료!

"cache": false,
"persistent": true
}
}
}