Skip to content
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

Lib doesnt seem to be working with paper-jsdom #5

Open
NoZ4 opened this issue Feb 21, 2020 · 1 comment
Open

Lib doesnt seem to be working with paper-jsdom #5

NoZ4 opened this issue Feb 21, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@NoZ4
Copy link

NoZ4 commented Feb 21, 2020

Hello
Been trying for a while to get the lib to work with paper-jsdom, been having real troubles, managed to get it not to through errors but then i'll call a function and it doesnt actully change the path

spent a couple of days on it and I have no idea whats wrong

Thanks

@glenzli glenzli added the bug Something isn't working label Apr 26, 2020
@stephanbogner
Copy link

I know this issue is old, but I did some investigation ... so if somebody stumbles on this, this is what I found:

I believe the issue is, that paperjs-offset lists PaperJS as a normal dependency.
If you use a newer version of PaperJS, paperjs-offset will also install version ^0.12.15, like here:
Screenshot 2021-05-07 at 14 58 22

If I run my code I get the following:

  • Error: TypeError: Cannot read property 'flatMap' of undefined
  • Erroneous code var children = nonSIPath.children.flatMap(function (c) {
  • Error source /node_modules/paperjs-offset/dist/index.umd.js:375

... but ... if I simply delete that node_modules folder within paperjs-offset everything works perfectly fine.

The fix:
I think it's as easy requiring PaperJS as a devDependency in the package.json.
I did this for my own purposes as a fork and it works perfectly fine. (I can now also require it in my package.json as "paperjs-offset": "git://github.com/stephanbogner/paperjs-offset.git#master")

If desired, I'd be happy to make a pull request with the adjusted package.json @glenzli

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants