doczjs / docz

✍ It has never been so easy to document your things!
https://docz.site
MIT License
23.63k stars 1.46k forks source link

Typescript docs example is broken #1318

Closed rafarovina closed 4 years ago

rafarovina commented 4 years ago

Bug Report

I tried to start the typescript example project, but when I run I have the following error:

ERROR #98123  WEBPACK

Generating SSR bundle failed

Unexpected token (19:21)

File: ../src/components/Button.tsx:19:21

 ERROR #98123  WEBPACK

Generating SSR bundle failed

Unexpected token (4:7)

File: ../src/components/Alert.tsx:4:7

To reproduce, just follow the instructions on the doc:

yarn create docz-app docz-app-typescript --example typescript
cd my-docz-app
yarn
yarn dev

I tried to create .doczrc.js as per docs. I still got the same error.

Not sure it's related, but I noticed that .docz/gatsby-config.js has typescript: false.

const config = {
  ...
  plugins: [
    {
      resolve: 'gatsby-theme-docz',
      options: {
        typescript: false,
        ts: false,
        ...

Environment

rakannimer commented 4 years ago

Thanks for catching and reporting this @rafarovina in the upcoming version you will no longer need to set typescript:true in your doczrc config. But I updated the example too early by mistake !

I updated the example, it should work now.

If you want to fix your project just add a doczrc.js file in the root directory with contents :

export default {
    typescript: true
}

or use the next docz version with : yarn add docz@next 👍

rafarovina commented 4 years ago

@rakannimer thanks for the extremely quick response! It works fine now

I can't believe I had a leading . on my doczrc.js file name 😱