-
Notifications
You must be signed in to change notification settings - Fork 485
Parse error (unexpected token) on dynamic import #1149
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
Comments
Yep, per this comment the dependencies that we relied on with Babel 6 compatibility are not yet available for Babel 7, so the 9.0.0-alpha.0 release temporarily drops dynamic |
@tmcw maybe |
[tc39/proposal-dynamic-import] chunk synthax with import() such as react-loadable not workingAny update on this? Is there a way to exclude those file that use We are having in our source files such as: 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 syntax with documentationjs OR exclude all files named |
This issue is pretty bad, would like if there was a way to ignore files, that'd be a good temp fix. No reason for one file to make the entire documentation fail. |
I agree. I don't know how to fix it otherwise it would already be. All our documentation in every small npm package we do are down as soon as we use one |
I have tried and #1205 did not solve #1149, without change I have this:
Using
|
@kopax did you solve the problem with these terrible dynamic imports? I just have the same problem. If you did, please, help me. |
No, I did not. I end up with this comment: #1205 (comment) |
Okay, it's sad. |
@amidf It is not sad, look #1205 (comment) |
If you're reporting a bug, please include input code, output documentation,
a description of what you expected to happen, and what happened instead.
When I comment this 'import' statement out, documentation.js runs fine. When I leave it in I get: "Icon.js: Unexpected token (52:10)".
I saw this was fixed in a PR last year but seems to be a problem for me?
The text was updated successfully, but these errors were encountered: