Skip to content

[tc39/proposal-dynamic-import] chunk synthax with import() such as react-loadable not working #1204

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
kopax opened this issue Feb 8, 2019 · 1 comment

Comments

@kopax
Copy link

kopax commented Feb 8, 2019

We are having in our source the following file:

import Loadable from 'react-loadable';

export default Loadable({
  loader: () => import('./index'),
});

Documentation fail with:

Error: Parsing file /home/dka/workspace/module.kopaxgroup.com/kopaxgroup-api/um-users/src/containers/AuthoritiesEdit/Loadable.js: Unexpected token (14:11)
    at Deps.parseDeps (/home/dka/workspace/module.kopaxgroup.com/kopaxgroup-api/um-users/node_modules/module-deps-sortable/index.js:515:28)
    at fromSource (/home/dka/workspace/module.kopaxgroup.com/kopaxgroup-api/um-users/node_modules/module-deps-sortable/index.js:450:44)
    at /home/dka/workspace/module.kopaxgroup.com/kopaxgroup-api/um-users/node_modules/module-deps-sortable/index.js:444:17
    at ConcatStream.<anonymous> (/home/dka/workspace/module.kopaxgroup.com/kopaxgroup-api/um-users/node_modules/module-deps-sortable/node_modules/concat-stream/index.js:36:43)
    at ConcatStream.emit (events.js:202:15)
    at finishMaybe (/home/dka/workspace/module.kopaxgroup.com/kopaxgroup-api/um-users/node_modules/module-deps-sortable/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:475:14)
    at endWritable (/home/dka/workspace/module.kopaxgroup.com/kopaxgroup-api/um-users/node_modules/module-deps-sortable/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:485:3)
    at ConcatStream.Writable.end (/home/dka/workspace/module.kopaxgroup.com/kopaxgroup-api/um-users/node_modules/module-deps-sortable/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:455:41)
    at DuplexWrapper.onend (/home/dka/workspace/module.kopaxgroup.com/kopaxgroup-api/um-users/node_modules/readable-stream/lib/_stream_readable.js:577:10)
    at Object.onceWrapper (events.js:285:13)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @kopaxgroup-api/um-users@0.0.0-development jsdoc-documentation: `jsdoc-documentation "src/**/*.js" "docs/js/jsdoc.md"`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the @kopaxgroup-api/um-users@0.0.0-development jsdoc-documentation script.

Version: 9.1.1

I bet it's the dynamic import. that's only stage 3 https://github.com/tc39/proposal-dynamic-import/#import

Is there a way to use this synthax with documentationjs?

@kopax kopax changed the title chunk synthax with import() such as react-loadable not working [tc39/proposal-dynamic-import] chunk synthax with import() such as react-loadable not working Feb 8, 2019
@kopax
Copy link
Author

kopax commented Feb 8, 2019

duplicate #1149

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant