Closed matthewp closed 6 years ago
There aren't actually multiple versions of can-cid. The way documentjs is configured is what causes this. I think a new approach to the build should be taken. I would:
node_modules/
folder.I created a new project to try out documentcss and I am having the same issue...
Here's a summary of what I did (TL;DR: followed the tutorial):
$ npm init
$ npm install documentjs --save
$ mkdir styles && touch styles/styles.md # and added the contents from the tutorial
$ touch documentjs.json # and added the contents from the tutorial
$ ./node_modules/.bin/documentjs
I am having the same issue with documentjs. I did everything according to the tutorial but I am getting this same error. Is there a fix?
`...patternlibrary2>.\node_modules.bin\documentjs
Generating styles at styleguide file:C:/****/patternlibrary2/node_modules/can-cid/can-cid.js:52 throw new Error("You can't have two versions of can-cid, check your dependencies"); ^
Error: You can't have two versions of can-cid, check your dependencies
at Object.
Changing can-cid
to not use a relative path for its own "main" also solved this problem. Changing these two to require("can-cid")...
made this error go away on a project we were seeing it on.
https://github.com/canjs/can-cid/blob/161fecf50e80f6a28ead9988ab956afeaa1ff93d/map/map.js#L3
https://github.com/canjs/can-cid/blob/161fecf50e80f6a28ead9988ab956afeaa1ff93d/set/set.js#L2
Should a project be able to import its own main using relative paths, @matthewp ?
Doing this in a simple project (outside documentjs) works fine, so I understand it is documentjs that is causing the problem with its build setup. Ignore my previous question.
I'm also seeing this issue, I'm using the 0.5.1 To make sure it wasn't an issue with my project, I've done the same as @danguilherme and created a brand new package with only documentcss, and it fails
This also happened to me and I cannot figure out how to fix this. Is there a workaround?
same here fails for a new project, another "living stlye guide generator" that does just does everything, but work
@sebs it's an open source project, submit a fix.
Hello,
I've been very annoyed by this error recently and I've searched what I could find in my installed modules.
It seems can-cid's security check is very drastic and not compliant at all when called twice (as expected with this error message), however I don't see where documentjs calls it.
I know nothing of can-cid's architecture but I tweaked the security off to see how my project would react, and it looks all ok, but I still have no clue about why this error is thrown.
The tweak is very simple btw, it's only a condition change in the last if in yourProject/node_modules/can-cid/can-cid.js so it enters the else execution.
Update : After removing the security in can-cid, my project didn't fail but on all the ".catch()" that npm asked me to put on asynchronous functions. After removing them, I was able to run again my project, even after can-cid reset. Hope this helps. :crossed_fingers:
Sorry. We’ve been unable to prioritize documentjs development.
Should be fixed in https://github.com/bitovi/documentjs/releases/tag/v0.5.2
Thanks! ;)
Error is: