antonlegoo / gitbook-plugin-theme-gestalt

A configurable theme for GitBook.
Apache License 2.0
17 stars 11 forks source link

TypeError: Cannot read property 'styles' of undefined #2

Open ppoetsma opened 7 years ago

ppoetsma commented 7 years ago

Hi,

I get this error after installing your theme:

C:\Users\paulp\GitBook\Library\Import\functional_design>gitbook serve --debug
Live reload server started on port: 35729
Press CTRL+C to quit ...

info: 13 plugins are installed
info: 10 explicitly listed
info: loading plugin "page-toc"... OK
info: loading plugin "back-to-top-button"... OK
info: loading plugin "styles-sass-fix"... OK
info: loading plugin "livereload"... OK
info: loading plugin "highlight"... OK
info: loading plugin "search"... OK
info: loading plugin "lunr"... OK
info: loading plugin "sharing"... OK
info: loading plugin "fontsettings"... OK
info: loading plugin "theme-gestalt"... OK
info: found 21 pages
info: found 45 asset files

TypeError: Cannot read property 'styles' of undefined
TypeError: Cannot read property 'styles' of undefined
    at Object.config (C:\Users\paulp\GitBook\Library\Import\functional_design\node_modules\gitbook-plugin-theme-gestalt\index.js:7:83)
    at C:\Users\paulp\.gitbook\versions\3.2.3\lib\output\callHook.js:48:29
    at C:\Users\paulp\.gitbook\versions\3.2.3\lib\utils\promise.js:22:20
    at _fulfilled (C:\Users\paulp\.gitbook\versions\3.2.3\node_modules\q\q.js:834:54)
    at self.promiseDispatch.done (C:\Users\paulp\.gitbook\versions\3.2.3\node_modules\q\q.js:863:30)
    at Promise.promise.promiseDispatch (C:\Users\paulp\.gitbook\versions\3.2.3\node_modules\q\q.js:796:13)
    at C:\Users\paulp\.gitbook\versions\3.2.3\node_modules\q\q.js:604:44
    at runSingle (C:\Users\paulp\.gitbook\versions\3.2.3\node_modules\q\q.js:137:13)
    at flush (C:\Users\paulp\.gitbook\versions\3.2.3\node_modules\q\q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
antonlegoo commented 7 years ago

Hi Paul,

I'm trying to reproduce your error in order to fix it. Could you provide the contents of your project's book.json? The file is probably at C:\Users\paulp\GitBook\Library\Import\functional_design\book.json

MattiSG commented 6 years ago

Hi @antonlegoo!

I get the same error. You can find the full project here: https://github.com/MattiSG/livre-blanc-communs-numeriques/tree/60a9ddb23ab6c4a65f9d09529441c9e1c645a8e1.

guyon commented 6 years ago

@antonlegoo @MattiSG

Try adding a styles property to book.json.

{
    "plugins": [
        "theme-gestalt",
        "-theme-default"
    ],
    "pluginsConfig": {
        "theme-gestalt": {
            "excludeDefaultStyles": true
        }
    },
    "styles": {
    }
}
guyon commented 6 years ago

more specific for example.

  1. copy from template scss(Github src) to styles directory.
  2. add book.json styles path
  3. gitbook install
  4. as you like edit styles/website/_page.scss
  5. gitbook build(scss comple) & serve
{
    "plugins": [
        "theme-gestalt",
        "-theme-default",
        "styles-sass-fix"
    ],
    "pluginsConfig": {
        "theme-gestalt": {
            "excludeDefaultStyles": true
        }
    },
    "styles": {
        "website": "./styles/website.scss"
    }
}

Lets see this documents. https://github.com/antonlegoo/gitbook-plugin-theme-gestalt#style-customization