Skip to content
New issue

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

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

Already on GitHub? # to your account

TypeError: Cannot set property constructor of [object Object] which has only a getter #1682

Open
2 tasks done
albertopiva opened this issue Sep 22, 2024 · 3 comments
Open
2 tasks done

Comments

@albertopiva
Copy link

What were you trying to do?

I'm trying to compile the project

How did you attempt to do it?

Following the guidelines in MAINTAINERSHIP.md, I run the build command.

Note: I only cloned the repo, installed the node_modules and ran the build command.

What actually happened?

It crashes with the following error:

/pdf-lib/node_modules/ttypescript/lib/loadTypescript.js:11
        function __() { this.constructor = d; }
                                         ^

TypeError: Cannot set property constructor of [object Object] which has only a getter

What did you expect to happen?

I expect to see the expected output as described in MAINTAINERSHIP.md.

How can we reproduce the issue?

You only need to clone the project, install node_modules and run the build command.

Version

v1.17.1

What environment are you running pdf-lib in?

Node

Checklist

  • My report includes a Short, Self Contained, Correct (Compilable) Example.
  • I have attached all PDFs, images, and other files needed to run my SSCCE.

Additional Notes

No response

@brandnday
Copy link

You need to upgrade ttypescript to version ^1.5.15. Re-install the packages and try to build again.

@albertopiva
Copy link
Author

albertopiva commented Nov 13, 2024

@brandnday thanks, seems working but I can notice that there're warnings at build time.
I also found another solution, using node v10 it works good.

EDIT: with your solution I have some build issue.

@mrwensveen
Copy link

Bumping ttypescript to 1.5.15 worked for me. Running on Nodejs v22.13.1.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@mrwensveen @brandnday @albertopiva and others