Docz: Docz build is not working for 1.0.0-rc.3

Created on 27 Mar 2019  Â·  17Comments  Â·  Source: doczjs/docz

Bug Report

The yarn docz:build generates the bundle successfully but it's broken (there are no components on the sidebar).

Describe the bug
I was able to write documentation in dev environment using yarn docz:dev but when I tried to generate a build to host this on a static file server, the rendered didn't have any components.

A clear and concise description of what the bug is.
It looks like this in dev:
image

Compared to this (after creating the production build):
image

To Reproduce

  1. Write a couple of .mdx file(s)
  2. Check if it's working – run yarn docz:dev and see it in the browser
  3. Create production build – yarn docz:build
  4. Check the generated bundle:
    sh cd .docz/dist python -m SimpleHTTPServer

In order to allow us to quickly reproduce you issue please include a link to a reproduction repository.
It's internal repo, can't provide a link

Expected behavior
Should generate the bundle similar to dev environment. When I switched the docz version to 0.13.7 the same setup worked fine.

Environment

  • OS: OSX 10.14.3
  • yarn version: 1.13.0

Most helpful comment

Hi guys, can you check which version of docz-core are installed? Btw, I'm getting some fixes and today I'll release a new release candidate version.

All 17 comments

Almost same as #710

I made a repo with this problem
https://github.com/ivan-dalmet/docz-issue-sandbox/tree/master/issue-710

Folder structure:

.docz
doczrc.js
src
 |--components
        |-- component.jsx
        |-- otherComponent.jsx
docs
 |-- component.mdx
 |-- otherComponent.mdx

Config:

export default {
  codeSandbox: false,
  themeConfig: {
    showPlaygroundEditor: true,
    codemirrorTheme: 'docz-dark'
  },
  modifyBundlerConfig: config => {
    config.module.rules.push({
      test: /\.css$/,
      use: ['style-loader', 'css-loader']
    });

    return config;
  }
};

@mitul45 is it working if you put the docs folder inside the src folder?

Nope, having the same issue.

Experiencing the same issue. Working like a charm in dev, but the built one does not. Looking in the build /static/js/ folder it does seem like it has built the files for the different pages, so the routing in itself seems to be the issue.

I believe this will be resolved after publishing a new version with fix https://github.com/pedronauck/docz/pull/725

@elv1n Can we confirm this?

@cupofjoakim I had the same problem and while waiting for a new release I published the package with the fix to '@elv1n/docz-core'.
Feel free to install it and check if fix works for you

// fakeDocz.js
#!/usr/bin/env node
require('@elv1n/docz-core').cli()

and run node ./fakeDocz build

@elv1n Partially worked. Still getting "Page Not Found", but some menu items are atleast rendering. Links to the stuff declared "Menu" in doczrc.js are rendered, but not navigatable. Child pages fetched from a different folder still isn't showing up.

Hi guys, can you check which version of docz-core are installed? Btw, I'm getting some fixes and today I'll release a new release candidate version.

Fixed in the newest release candidate :)

Hey @pedronauck, thanks a bunch for solving this so quickly, super nice!

Thank you for the help, everyone!

I don't think this issue is resolved.

I just did a fresh rc7 setup and I'm getting a page not found. When using the navigation I end up going to 'http://src-hello-world-hello-world/' moving away from the docz page.

File structure:

| -- .docz
| --  src
       | -- hello-world
             | -- hello-world.mdx

mdx content

---
name: Hello world
---

# Hello world

I'm also still getting "Page not found".

@cupofjoakim I found another issue where someone mentioned adding a route to the meta data for the homepage. I got a basic setup working now after applying this change + #747

---
name: Hello world
route: /
---

# Hello world

yeah routes are broken too in rc7

route: '/some_route' will result in http://some_route

Was this page helpful?
0 / 5 - 0 ratings

Related issues

hayk94 picture hayk94  Â·  3Comments

regrettably picture regrettably  Â·  3Comments

ssylvia picture ssylvia  Â·  3Comments

capaj picture capaj  Â·  3Comments

mquandalle picture mquandalle  Â·  3Comments