-
Notifications
You must be signed in to change notification settings - Fork 486
Error when dealing with multiple exports #950
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
Previously: #483 - this remains an elusive bug, reported often in babelify, most recently in babel/babelify#186 - maybe one of the comments on that issue helps you find a fix? |
I don't use browserify (and by extension I think that means babelify). This is purely caused by index.js, when I don't have it that way (multiple exports), there's no problem. |
So I've isolated the problem even further. It is exactly the: |
This bug is now resolved in 5.3.5. |
I'm having the same issue with version 5.4.0
What's interesting everything works in my local environment: But it does not in my docker container in gitlab-ci with the same version of node. The error occured after webpack upgrade (from version 1 -> 3), but the project build and all tests run fine. |
I have the same error with typescript files. npm run docs
> [email protected] docs /stylelint-declaration-strict-value
> documentation build src/lib/*.ts --pe ts --re .ts -f md -o API.md
Error: Parsing file /stylelint-declaration-strict-value/src/lib/validation.ts: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
at Deps.parseDeps (/stylelint-declaration-strict-value/node_modules/module-deps-sortable/index.js:515:28)
at fromSource (/stylelint-declaration-strict-value/node_modules/module-deps-sortable/index.js:450:44)
at /stylelint-declaration-strict-value/node_modules/module-deps-sortable/index.js:444:17
at ConcatStream.<anonymous> (/stylelint-declaration-strict-value/node_modules/module-deps-sortable/node_modules/concat-stream/index.js:36:43)
at ConcatStream.emit (events.js:203:15)
at finishMaybe (/stylelint-declaration-strict-value/node_modules/module-deps-sortable/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:475:14)
at endWritable (/stylelint-declaration-strict-value/node_modules/module-deps-sortable/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:485:3)
at ConcatStream.Writable.end (/stylelint-declaration-strict-value/node_modules/module-deps-sortable/node_modules/concat-stream/node_modules/readable-stream/lib/_stream_writable.js:455:41)
at DuplexWrapper.onend (/stylelint-declaration-strict-value/node_modules/readable-stream/lib/_stream_readable.js:577:10)
at Object.onceWrapper (events.js:286:20) |
** Not a problem with documentation or packages, but with yarn, yarn.lock, and node-modules, see post below ** I just got the dreaded Error: Parsing .. error that this issue is following. I was using:
and upgraded to
and ran into
The documentation command is:
In this case, it appears that commits after 13.2.2 but before 13.2.3 may be revealing:
My impression is that it relates to the dependencies, not documentation.js per se. Oddly enough, when I do a yarn (install) switching back to 13.2.2 I get this message: warning Pattern ["object-assign@latest"] is trying to unpack in the same destination "/Users/owen/Library/Caches/Yarn/v6/npm-object-assign-4.1.1-2109adc7965887cfc05cbbd442cac8bfbb360863-integrity/node_modules/object-assign" as pattern ["object-assign@","object-assign@","object-assign@*","object-assign@^4.0.1","object-assign@^4.1.0","object-assign@^4.0.1","object-assign@^4.1.1","object-assign@^4"]. This could result in non-deterministic behavior, skipping. If it would help, I could create a repo having only documentation.js and the source files, and see if the problem remains. This mainly to minimize interaction with the various other packages. Here is the entire error stack. Error: Parsing file /Users/owen/Dropbox/src/agentscript/src/DataSet.js: 'import' and 'export' may appear only with 'sourceType: module' (1:0) |
I decided to go ahead and make a separate repo, free of all the dependencies of my repo that failed. Here's the package.json:
Yarn install works fine, and npm run build creates the docs correctly. I do get a warning: warning "documentation > @vue/[email protected]" has unmet peer dependency "[email protected]". The repo is: https://github.com/backspaces/docbug Click on Docs to see the resulting documentation. Sooo .. as we suspected, the difficulty relates to dependencies and their interaction. Here are the dependencies of the original repo:
On a whim, I put these in the docbug package.json to make sure it would fail So I did that and ran Yarn, then ran the build script .. and it worked!! WTF? So I removed both node-modules and the yarn.lock and then yarn installed. Sigh, it then all worked! ** So summary: apparently there was some weird interaction between yarn.lock, package.json and yarn install. Zapping yarn.lock and node-modules, then running yarn somehow fixed things. ** |
- publish next version - package.json - update to latest documentation.js - build-docs: alphabetical sort - documentation - lots of jsDoc comments additions/upgrades - documentationjs/documentation#950 Resolve problem with complete wipe of node_modules etc & rebuild.
I get this error on 5.3.3:
When running
documentation build ./lib/** -f html -o ./doc
on alib/index.js
:Full project https://github.com/MatrixAI/js-virtualfs
The text was updated successfully, but these errors were encountered: