docz: TypeError: n is not a function

Bug Report

docz: 0.12.17 & 0.13.5

To Reproduce npx docz dev

/Users/puwei/Dev/test/test_lib/test-library/node_modules/_docz-core@0.12.16@docz-core/dist/index.js:5227
        n({
        ^

TypeError: n is not a function
    at parseHtml (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_docz-core@0.12.16@docz-core/dist/index.js:5227:9)
    at template (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_docz-core@0.12.16@docz-core/dist/index.js:5365:21)
    at MiniHtmlWebpackPlugin.plugin (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_mini-html-webpack-plugin@0.2.3@mini-html-webpack-plugin/index.js:17:33)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_tapable@1.1.1@tapable/lib/HookCodeFactory.js:32:10), <anonymous>:12:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_tapable@1.1.1@tapable/lib/Hook.js:154:20)
    at Compiler.emitAssets (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_webpack@4.28.2@webpack/lib/Compiler.js:363:19)
    at onCompiled (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_webpack@4.28.2@webpack/lib/Watching.js:50:19)
    at hooks.afterCompile.callAsync.err (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_webpack@4.28.2@webpack/lib/Compiler.js:552:14)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_tapable@1.1.1@tapable/lib/HookCodeFactory.js:32:10), <anonymous>:15:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_tapable@1.1.1@tapable/lib/Hook.js:154:20)
    at compilation.seal.err (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_webpack@4.28.2@webpack/lib/Compiler.js:549:30)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_tapable@1.1.1@tapable/lib/HookCodeFactory.js:32:10), <anonymous>:9:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_tapable@1.1.1@tapable/lib/Hook.js:154:20)
    at hooks.optimizeAssets.callAsync.err (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_webpack@4.28.2@webpack/lib/Compilation.js:1323:35)
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_tapable@1.1.1@tapable/lib/HookCodeFactory.js:32:10), <anonymous>:9:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/puwei/Dev/test/test_lib/test-library/node_modules/_tapable@1.1.1@tapable/lib/Hook.js:154:20)

I flowed the minified code, found that e is string โ€˜nullโ€™, not null.

getHtmlFilepath = e =>
    e ? path.resolve(root$1, e) : fromTemplates("index.tpl.html"),
htmlTemplate = async e =>
    compiled(getHtmlFilepath(e), { minimize: !1, escape: !1 }),

so it complied an error:

 { Error: ENOENT: no such file or directory, open '/Users/puwei/Dev/test/test_lib/test-library/null'
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/puwei/Dev/test/test_lib/test-library/null' }

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 5
  • Comments: 33 (14 by maintainers)

Commits related to this issue

Most upvoted comments

Now docz-core is updated with the latest version, thanks @simonepri ๐Ÿ™The bug is fixed, Iโ€™m releasing some new version fixing this bug ๐Ÿ˜ƒ

right, Iโ€™m reverting and releasing now ๐Ÿ™

Fixed on v0.13.7 โœ…

Meet another problem when setting with null manually, and what value should I set?

Module not found: Can't resolve 'null' in 'xxx/.docz/app'

bad: image good: an old repo(yesterday) image

Yes 2.0.1 is stable and tested.

@pedronauck Iโ€™ve unpublished env-dot-prop@1.1.1 and released env-dot-prop@1.1.2.

These kind of errors should not happen again with the new unit test in env-dot-prop@2.x. Sorry again.

@pedronauck changes can be found here

Experiencing the same issue. Fresh installation, never used docz on the project.

Setting indexHtml option in doczrc.js to undefined resolved the issue for me:

// ./doczrc.js
module.exports = {
  indexHtml: undefined
}

However, this produces the next issue:

Module not found: Can't resolve 'null' in '/Users/.../libs/msw/.docz/app'

Nethier '' nor undefined as the value of indexHtml make any difference here.

Rolled down to 0.12.2 (3 months old version), the issue with not found null module is still there.

@jedrichards if you had the yarn.lock in version control before your rm -rf node_modules && rm yarn.lock && yarn install would diffing the previous version against your current yarn.lock reveal some potential candidates for what has changed?