doczjs/docz

Can't run docz after a fresh install

Closed this issue Β· 20 comments

Bug Report

Getting an error when running yarn run docz dev on a fresh install (from the getting started guidelines)

To Reproduce

  1. mkdir test_project
  2. yarn add docz
  3. yarn run docz dev
  4. See error
 WARNING  Compiled with 11 warnings                                                                                                                                                                 07:18:24

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

Environment

  • OS: [OSX Mojave 10.14]
  • Node/npm version: [ Node 8.11.2 /npm 6.4.1 / yarn 1.9.4]

Additional context/Screenshots

Tried on two different computers no luck.
A previous project that I had running and configured started failing with the same error after I added a dependency. (I assume a dependency of docz changed and is causing this error?)

Thanks!!

Downgrading the local version of buble (which is a dependency of docz) fixed the issue.

yarn add buble@0.19.4

More details here: bublejs/buble#159

@rafaelchiti It just builds success. when you open in the browser, The console shows error:

Uncaught TypeError: Cannot set property 'jsx' of undefined
    at inject (webpack-internal:///./node_modules/buble/dist/buble-browser.es.js:639)
    at eval (webpack-internal:///./node_modules/buble/dist/buble-browser.es.js:9823)
    at Array.reduce (<anonymous>)
    at Module.eval (webpack-internal:///./node_modules/buble/dist/buble-browser.es.js:9822)
    at eval (webpack-internal:///./node_modules/buble/dist/buble-browser.es.js:9918)
    at Module../node_modules/buble/dist/buble-browser.es.js (vendors.js:1286)
    at __webpack_require__ (runtime~app.js:788)
    at fn (runtime~app.js:151)
    at eval (webpack-internal:///./node_modules/react-live/dist/react-live.es.js:26)
    at Module../node_modules/react-live/dist/react-live.es.js (vendors.js:5579)

Experiencing the same issue. Tried downgrading buble and acorn. No luck.

Having the same problem. Also tried downgrading acorn, but did not work.

So @rafaelchiti 's suggestion of downgrading buble to v0.19.4 worked to compile and get it running in the browser.

Downgrading the local version of buble (which is a dependency of docz) fixed the issue.

yarn add buble@0.19.4

More details here: Rich-Harris/buble#159

But it looks like this pull request is trying to fix the issue itself, not just downgrading temporarily.

Same issue as reported. addinb buble@0.19.4 fixes docz build but still there's the JSX warning. Anyone managed to solve this another way?

Hi guys, sorry the too late response, last weeks was very hard to me and I couldn't see anything about docz, but now I available again... I'll check and try to fix this πŸ™

This just brakes my whole trust on open source. Wanted to drop it here.

you can always fix it yourself and keep trusting it.

@kucukkanat Things happen! Also you spelled β€œbreaks” incorrectly. Maybe you just broke my entire trust in dictionaries.

Oh no you guys made him delete his comment! Pretty funny though... Please @pedronauck restore my faith in Open Source. is this fixed yet?

@pedronauck this can be closed. buble fixed their bug so this is no longer an issue again.

I'm still experiencing the same problem. I removed buble from my dependencies and removed/re-installed node_modules. Any ideas?

 WARNING  Compiled with 11 warnings                                  09:29:59

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

 warning  in ./node_modules/buble/dist/buble-browser.es.js

"export 'default' (imported as 'require$$0') was not found in 'acorn'

Try running npm cache clear --force && npm cache clean.

Closing the issue. Let me know if anyone else is still having the issue after deleting their node_modules folder and clearing the package manager's cache.

I've not been able to get this resolved after following these steps locally (before trying to apply them to my CI/CD pipeline):

1. rm -rf node_modules
2. npm cache clear --force
3. npm cache clean --force
4. npm install

However, it does not work when replacing npm install with yarn

This project is based on yarn so that makes sense.

The two relevant commands that may need ran can be combined into npm cache clear --force && yarn cache clean

Interesting. Doing these steps didn't fix it:

1. rm -rf node_modules
2. npm cache clear --force
3. yarn cache clean
4. yarn

Can you look and see which version of buble got installed?

A yarn why buble tells me buble@0.19.5, which isn't the latest (as of 5 days ago). But I'm also not sure how to force myself and our CI pipeline to use 0.19.6, if that is the fix.

16:02 $ yarn why buble
yarn why v1.10.1
[1/4] πŸ€”  Why do we have the module "buble"...?
[2/4] 🚚  Initialising dependency graph...
[3/4] πŸ”  Finding dependency...
[4/4] 🚑  Calculating file sizes...
=> Found "buble@0.19.5"
info Reasons this module exists
   - "docz-theme-default#react-live" depends on it
   - Hoisted from "docz-theme-default#react-live#buble"
info Disk size without dependencies: "6.28MB"
info Disk size with unique dependencies: "6.28MB"
info Disk size with transitive dependencies: "6.28MB"
info Number of shared dependencies: 17

Adding "buble": "^0.19.6 to your package.json should do the trick.