Gatsby: _styledComponents.ServerStyleSheet๋Š” ์ƒ์„ฑ์ž ์˜ค๋ฅ˜๊ฐ€ ์•„๋‹™๋‹ˆ๋‹ค.

์— ๋งŒ๋“  2017๋…„ 12์›” 14์ผ  ยท  3์ฝ”๋ฉ˜ํŠธ  ยท  ์ถœ์ฒ˜: gatsbyjs/gatsby

์„ค๋ช…

๋‚ด github ํŽ˜์ด์ง€์— ๋Œ€ํ•ด yarn ๋ฐฐํฌ๋ฅผ ์‹คํ–‰ํ•  ๋•Œ ์ด ์›นํŒฉ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

"deploy": "gatsby build --prefix-paths && gh-pages -d public",

error Building static HTML for pages failed`

`See our docs page on debugging HTML builds for help https://goo.gl/yL9lND`

  `16 |       setHeadComponents = _ref.setHeadComponents;
  17 |
> 18 |   var sheet = new _styledComponents.ServerStyleSheet();
     | ^
  19 |
  20 |   var app = _react2.default.createElement(
  21 |     _styledComponents.StyleSheetManager,`


`WebpackError: _styledComponents.ServerStyleSheet is not a constructor`

  - gatsby-ssr.js:18 Object.exports.replaceRenderer
    ~/gatsby-plugin-styled-components/gatsby-ssr.js:18:1

  - api-runner-ssr.js:23
    .cache/api-runner-ssr.js:23:41


  - api-runner-ssr.js:21 module.exports
    .cache/api-runner-ssr.js:21:25

  - static-entry.js:113 module.exports
    .cache/static-entry.js:113:3

  - static-entry.js:99 Function.Promise.fromNode.Promise.fromCallback
    .cache/static-entry.js:99:20





error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

gatsby-plugin-styled-components: "2.0.2" ๋ฐ styled-components: "2.2.4" ์žˆ์Šต๋‹ˆ๋‹ค.

gatsby-pluging-styled-components๊ฐ€ SSR์„ ์ฒ˜๋ฆฌํ–ˆ์–ด์•ผ ํ–ˆ์Šต๋‹ˆ๊นŒ? ์•„๋‹ˆ๋ฉด ์—ฌ์ „ํžˆ ์ˆ˜๋™์œผ๋กœ ๊ตฌ์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๊นŒ? ๋ช‡ ๋‹ฌ ์ „์— ๋‚ด github ํŽ˜์ด์ง€์˜ ์ฒซ ๋ฒˆ์งธ ๋ฒ„์ „์„ ๋ฐฐํฌํ–ˆ์„ ๋•Œ ์ œ๋Œ€๋กœ ์ž‘๋™ํ–ˆ์Šต๋‹ˆ๋‹ค.

๊ฐ€์žฅ ์œ ์šฉํ•œ ๋Œ“๊ธ€

Google์—์„œ ์—ฌ๊ธฐ์— ์˜ค๋Š” ๋ชจ๋“  ์‚ฌ๋žŒ์„ ์œ„ํ•ด ....
@material-ui/core/styles๊ฐ€ ์‹ค์ œ๋กœ ServerStyleSheets๋ฅผ ๋‚ด๋ณด๋‚ด๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.

์ด๊ฒƒ์€ ๋‚ด๊ฐ€ ๋” ์˜ค๋ž˜๋œ material-ui/core(3.9.x)๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๊นจ๋‹ซ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค.
4.5.1๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜์—ฌ ์ˆ˜์ •๋จ

๋ชจ๋“  3 ๋Œ“๊ธ€

๋ฌธ์ œ๋ฅผ ๋‹ซ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์Šคํƒ€์ผ ๊ตฌ์„ฑ ์š”์†Œ์— ๋Œ€ํ•œ ํ”ผ์–ด ์ข…์†์„ฑ์„ ์„ค์น˜ํ•˜์ง€ ์•Š์•˜๊ธฐ ๋•Œ๋ฌธ์— ๊นจ๋‹ฌ์•˜์Šต๋‹ˆ๋‹ค.

@jaanhio ์–ด๋–ป๊ฒŒ ํ•ด๊ฒฐํ•˜์…จ๋‚˜์š”? ๋‚˜๋„ ๊ฐ™์€ ์ข…๋ฅ˜์˜ ์˜ค๋ฅ˜๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค.

TypeError: _material_ui_core_styles__WEBPACK_IMPORTED_MODULE_10__.ServerStyleSheets is not a constructor
    at eval (webpack:///./server/helpers/renderer.js?:37:16)
    at eval (webpack:///./server/index.js?:54:81)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)

Google์—์„œ ์—ฌ๊ธฐ์— ์˜ค๋Š” ๋ชจ๋“  ์‚ฌ๋žŒ์„ ์œ„ํ•ด ....
@material-ui/core/styles๊ฐ€ ์‹ค์ œ๋กœ ServerStyleSheets๋ฅผ ๋‚ด๋ณด๋‚ด๋Š”์ง€ ํ™•์ธํ•˜์‹ญ์‹œ์˜ค.

์ด๊ฒƒ์€ ๋‚ด๊ฐ€ ๋” ์˜ค๋ž˜๋œ material-ui/core(3.9.x)๋ฅผ ์‹คํ–‰ํ•˜๊ณ  ์žˆ๋‹ค๋Š” ๊ฒƒ์„ ๊นจ๋‹ซ๊ฒŒ ํ•ฉ๋‹ˆ๋‹ค.
4.5.1๋กœ ์—…๊ทธ๋ ˆ์ด๋“œํ•˜์—ฌ ์ˆ˜์ •๋จ

์ด ํŽ˜์ด์ง€๊ฐ€ ๋„์›€์ด ๋˜์—ˆ๋‚˜์š”?
0 / 5 - 0 ๋“ฑ๊ธ‰

๊ด€๋ จ ๋ฌธ์ œ

totsteps picture totsteps  ยท  3์ฝ”๋ฉ˜ํŠธ

kalinchernev picture kalinchernev  ยท  3์ฝ”๋ฉ˜ํŠธ

ferMartz picture ferMartz  ยท  3์ฝ”๋ฉ˜ํŠธ

magicly picture magicly  ยท  3์ฝ”๋ฉ˜ํŠธ

jimfilippou picture jimfilippou  ยท  3์ฝ”๋ฉ˜ํŠธ