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
- fix: indexHtml is null https://github.com/pedronauck/docz/issues/551 — committed to umijs/umi-plugin-library by clock157 6 years ago
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?bad:
good: an old repo(yesterday)

Yes
2.0.1
is stable and tested.@pedronauck Iโve unpublished
env-dot-prop@1.1.1
and releasedenv-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 indoczrc.js
toundefined
resolved the issue for me:However, this produces the next issue:
Nethier
''
norundefined
as the value ofindexHtml
make any difference here.Rolled down to
0.12.2
(3 months old version), the issue with not foundnull
module is still there.@jedrichards if you had the
yarn.lock
in version control before yourrm -rf node_modules && rm yarn.lock && yarn install
would diffing the previous version against your currentyarn.lock
reveal some potential candidates for what has changed?