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

[examples] Add a Gatsby example #9779

Merged
merged 1 commit into from
Jan 7, 2018

Conversation

oliviertassinari
Copy link
Member

Closes #9777

@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label Jan 7, 2018
@magicmark
Copy link
Contributor

@oliviertassinari Seems to not be building for me with a fresh install:

╔═ mark@mark: /var/folders/68/4brvn_sn33l8hdvkwsd5wnr80000gn/T/tmp.UMSrtAGKNJ
╚═ ♪ curl https://codeload.github.com/mui-org/material-ui/tar.gz/v1-beta | tar -xz --strip=2  material-ui-1-beta/examples/gatsby

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 1824k    0 1824k    0     0  1837k      0 --:--:-- --:--:-- --:--:-- 1837k

╔═ mark@mark: /var/folders/68/4brvn_sn33l8hdvkwsd5wnr80000gn/T/tmp.UMSrtAGKNJ/gatsby
╚═ ♪ yarn
yarn install v1.3.2
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning gatsby > babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update!
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "gatsby > postcss-cssnext@2.11.0" has unmet peer dependency "caniuse-db@^1.0.30000652".
warning "material-ui > react-scrollbar-size@2.0.2" has unmet peer dependency "lodash@^4.17.0".
[4/4] 📃  Building fresh packages...
[1/3] ⠂ fsevents
[1/3] ⠄ fsevents
[-/3] ⠠ waiting...
[-/3] ⠐ waiting...
[2/3] ⠐ uws
[-/3] ⢀ waiting...
[-/3] ⠠ waiting...
[2/3] ⠠ uws
success Saved lockfile.
✨  Done in 24.25s.

╔═ mark@mark: /var/folders/68/4brvn_sn33l8hdvkwsd5wnr80000gn/T/tmp.UMSrtAGKNJ/gatsby
╚═ ♪ yarn run develop
yarn run v1.3.2
$ gatsby develop
success delete html files from previous builds — 0.005 s
success open and validate gatsby-config.js — 0.004 s
success copy gatsby files — 0.015 s
success onPreBootstrap — 0.005 s
success source and transform nodes — 0.014 s
success building schema — 0.060 s
success createLayouts — 0.005 s
success createPages — 0.005 s
success createPagesStatefully — 0.021 s
success onPreExtractQueries — 0.000 s
success update schema — 0.037 s
success extract queries from components — 0.053 s
success run graphql queries — 0.021 s
success write out page data — 0.001 s
success write out redirect data — 0.000 s
success onPostBootstrap — 0.000 s

info bootstrap finished - 2.562 s

error There was an error compiling the html.js component for the development server.

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

  78 |  */
  79 | function decomposeColor(color) {
> 80 |   if (color.charAt(0) === '#') {
     | ^
  81 |     return decomposeColor(convertHexToRGB(color));
  82 |   }
  83 |


  WebpackError: Cannot read property 'charAt' of undefined

  - colorManipulator.js:80 decomposeColor
    ~/material-ui/styles/colorManipulator.js:80:1

  - colorManipulator.js:226 lighten
    ~/material-ui/styles/colorManipulator.js:226:1

  - createPalette.js:144 createPalette
    ~/material-ui/styles/createPalette.js:144:1

  - createMuiTheme.js:71 createMuiTheme
    ~/material-ui/styles/createMuiTheme.js:71:1

  - getPageContext.js:10 Object.defineProperty.value
    src/getPageContext.js:10:30

  - gatsby-ssr.js:6 Object.defineProperty.value
    gatsby-ssr.js:6:1

  - api-runner-ssr.js:2 Object.<anonymous>
    .cache/api-runner-ssr.js:2:15


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

related to #9590 / #8075 maybe?

@magicmark
Copy link
Contributor

Ah this is probably due to the changes here
https://github.com/mui-org/material-ui/releases/tag/v1.0.0-beta.28

The following diff fixes this, I'll send a PR

diff --git a/src/getPageContext.js b/src/getPageContext.js
index ad98484..70b7891 100644
--- a/src/getPageContext.js
+++ b/src/getPageContext.js
@@ -9,8 +9,16 @@ import green from 'material-ui/colors/green';
 // It's optional.
 const theme = createMuiTheme({
   palette: {
-    primary: purple,
-    secondary: green,
+    primary: {
+      light: purple[300],
+      main: purple[500],
+      dark: purple[700],
+    },
+    secondary: {
+      light: green[300],
+      main: green[500],
+      dark: green[700],
+    }
   },
 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants