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

Polyclip-ts makes my program unable to run. #2800

Closed
ping-an-na opened this issue Dec 30, 2024 · 13 comments
Closed

Polyclip-ts makes my program unable to run. #2800

ping-an-na opened this issue Dec 30, 2024 · 13 comments

Comments

@ping-an-na
Copy link

I'm sorry I'm a rookie. I have updated to the latest version 7.2.0. Maybe I can't start Polyclip-ts because it is ts.
It's been bothering me all morning.Now I've taken care of him.But I hope I can help you.

@smallsaucepan
Copy link
Member

Hi @ping-an-na. Are you saying you're having trouble with getting Turf to run? Is there an error message that you can see? Tell us some more information and we can try to help.

@ping-an-na
Copy link
Author

image

Thank you. I hope we can work this out together.
Can you see the pictures I sent?
I repeated the question.
Probably because my project doesn't support TS.
My solution was to set the version to 7.1.0

@smallsaucepan
Copy link
Member

I think what this error is saying is the Javascript in polyclip-ts is more modern that what your Vue application is expecting to see. Don't think it's typescript related.

To help troubleshoot, can you please answer some questions? Is this a new project? Or is it an old one? Are your vue and babel versions up to date? Would you mind sharing your package.json, tsconfig.json, and babel configuration?

If i were to try to reproduce this myself, is your app a fairly normal Vue 3 app?

@ping-an-na
Copy link
Author

Thank you for your explanation, because I can't fully understand these error messages.

This is an old project. I'm using vue2.
It may not be easy for you to try to repeat the same effect.
I've invited you to join a project where you can clone it and take a look.

@smallsaucepan
Copy link
Member

Thanks @ping-an-na. I will take a look. What command are you running when you see that error?

@ping-an-na
Copy link
Author

npm run dev

@ping-an-na
Copy link
Author

npm -v // 6.14.18
node -v // 14.14.0

@smallsaucepan
Copy link
Member

Thanks @ping-an-na. I tried running the repo you shared, but ran into python errors.

Found this article which displays a very similar error, and suggests vue 2.7 should not have this problem: https://stackoverflow.com/a/67282216/3606644

Noticed you are using vue 2.6.10, so are you able to update to 2.7.16 and see if that helps?

@ping-an-na
Copy link
Author

I updated VUE to version 2.7.16 and re-ran it, but there were still error messages and no changes.
I'll go and take a look at the article you sent.
My English is not very good. It will take me some time to understand.

@ping-an-na
Copy link
Author

I don't understand what repo means, and I don't know why there are python error.
It could be your environment variable.
If npm and node versions are correct.
Just git clone, npm install, npm run dev.
I'm sorry I don't understand.

@smallsaucepan
Copy link
Member

That's ok @ping-an-na.

repo = repository, https://github.com/ping-an-na/RuiFengDataScreen

Try this instead. Add the below transpileDependencies to your view.config.js:

module.exports = {
  transpileDependencies: [
    'polyclip-ts',
    'splaytree-ts'
  ],
  ...

This will tell babel to convert those two libraries to the older version of Javascript your project is using. Then npm run dev works:

Screenshot 2025-01-01 at 13 35 24

This works even without having to upgrade vue as I suggested above.

@ping-an-na
Copy link
Author

Very, very, very good.
Yes, the problem was solved perfectly. Thank you very much for your help.
You were amazing. You were so professional. You've always been my idol.
I'm going to write an article about this. Maybe it can help someone else.
To express my feelings to you again. I wish you good health.

@smallsaucepan
Copy link
Member

You're very welcome. Glad we were able to help! Thank you for offering to share the solution with other people.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants