Inflearn Community Q&A
config.authCookieName 에서 타입 오류가 발생합니다.
Written on
·
172
0
[vue-tsc] Argument of type 'unknown' is not assignable to parameter of type 'string'./workspace/dev/nuxt-tutorial/server/routes/auth/login.post.ts:38:2036 | 37 | const config = useRuntimeConfig(); > 38 | setCookie(event, config.authCookieName, JSON.stringify(userWithoutPassword)); | ^^^^^^^^^^^^^^^^^^^^^ 39 | 40 | return { 41 | user: userWithoutPassword,[vue-tsc] Argument of type 'unknown' is not assignable to parameter of type 'string'.
/workspace/dev/nuxt-tutorial/server/utils/auth.ts:5:433 | export function getUserFromEvent(event: H3Event) { 4 | const config = useRuntimeConfig(); > 5 | const userJsonString = getCookie(event, config.authCookieName); | ^^^^^^^^^^^^^^^^^^^^^ 6 | 7 | console.log('userJsonString: ', userJsonString);
config.authCookieName 에서 타입 오류가 발생하는데 어떻게 해결 할 수 있을까요..?
vue.jsnuxt.jspiniavue-3
Answer 1
0
gymcoding
Instructor
안녕하세요 😀
RuntimeConfig Type 관련해서 아래 링크를 참고하시면 될 것 같습니다.
https://nuxt.com/docs/guide/going-further/runtime-config#typing-runtime-config





