notes

nextjs `.env` on Amplify (👎👎👎👎👎)2022. 1. 21.

  1. next-auth로 auth 를 이케저케한 프로젝트를 앰플리파이에 배포해봤음
  2. signIn시 서버에러 발생
  3. error message was like this:
    https://next-auth.js.org/errors#client_fetch_error Unexpected token < in JSON at position 0 {error: {…}, path: 'providers', message: 
    'Unexpected token < in JSON at position 0'}
    https://next-auth.js.org/errors#client_fetch_error Unexpected token < in JSON at position 0 {error: {…}, path: 'providers', message: 
    'Unexpected token < in JSON at position 0'}
  4. 알아보니 amplify web ui에서 입력한 env var가 안먹는 것이었음
  5. amplify.yml에 아래와 같은 짓을 하는 수 밖에 없었음
    - echo "NEXTAUTH_SECRET=$NEXTAUTH_SECRET" >> .env
    - echo "NEXTAUTH_URL=$NEXTAUTH_URL" >> .env
    

() vs. '()2021. 7. 28.

(+ 1 2 3 4)     ;; <1>

'(+ 1 2 3 4)    ;; <2>
(+ 1 2 3 4)     ;; <1>

'(+ 1 2 3 4)    ;; <2>
  1. A list that is interpreted as an expression and evaluated
  2. Prevent evaluation of a list by starting it with a single quote

isReactElement2021. 3. 19.

const isReactElement = (element: ReactNode): element is ReactElement =>
  element !== null && typeof element === 'object' && 'props' in element;
const isReactElement = (element: ReactNode): element is ReactElement =>
  element !== null && typeof element === 'object' && 'props' in element;

Tags