• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    미해결

develop 은 되는데 build 환경에서의 오류

22.04.09 13:38 작성 조회수 182

1

Building static HTML failed for path "/main/postItem/"

 

See our docs page for more info on this error: https://gatsby.dev/debug-html

 

 

  19 |   categories,

  20 |   summary,

> 21 |   thumbnail: { publicURL },

     |                ^

  22 |   link,

  23 | }) => {

  24 |   return (

 

 

  WebpackError: TypeError: Cannot read properties of undefined (reading 'publicURL')

  

  - postItem.tsx:21 

    gatsby-starter-default/src/pages/main/postItem.tsx:21:16

  

  - inheritsLoose.js:5 

    [gatsby-starter-default]/[@babel]/runtime/helpers/inheritsLoose.js:5:1

  

  - emotion-is-prop-valid.esm.js:15 

    [gatsby-starter-default]/[@emotion]/is-prop-valid/dist/emotion-is-prop-valid.esm.js:15:1

  

  - inheritsLoose.js:7 

    [gatsby-starter-default]/[@babel]/runtime/helpers/inheritsLoose.js:7:1

  

  - static-entry.js:294 

    gatsby-starter-default/.cache/static-entry.js:294:22

  

  - history.js:49 

    [gatsby-starter-default]/[@gatsbyjs]/reach-router/es/lib/history.js:49:6

  

 

 

publicUrl 이 없으면 build 환경에서 잘 동작합니다. 

저 구문만 있으면 build 환경에서 돌아가지 않습니다..!

 

https://github.com/urther/example

레포 주소 첨부합니다 ㅠㅠ 

8000/graphql 에서 publicUrl 정상 동작하는것도 확인했습니다! 

답변 1

답변을 작성해보세요.

0

안녕하세요, 박민지님!

레포를 확인해보니 publicURL 대신 gatsbyImageData 프로퍼티가 들어가있네요!

혹시 문제 해결하셨는지 알 수 있을까요?