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

Eval breaks imports #6070

Closed
Smrtnyk opened this issue Oct 6, 2022 · 4 comments
Closed

Eval breaks imports #6070

Smrtnyk opened this issue Oct 6, 2022 · 4 comments

Comments

@Smrtnyk
Copy link

Smrtnyk commented Oct 6, 2022

Describe the bug

Seems like eval used in a function, even if the function is never used, breaks imports in the file.
Here is the repro repository
https://github.com/Smrtnyk/swc-modules-import-repro

clone it, run npm install and then npm run transpile

I have put a break point and seems like only one import is considered

if you remove the evaluatedCodeWrapper function from the code, then it works again
seeems like problem is the eval.call line

This is blocking our upgrade of swc 1.197 to 1.3.4

Input code

No response

Config

No response

Playground link

No response

Expected behavior

eval.call in unused function should not break imports

Actual behavior

No response

Version

1.3.4

Additional context

No response

@kdy1
Copy link
Member

kdy1 commented Oct 6, 2022

Please fill the input forms. Also, please provide a repro case which does not involve 3rd-party library

@Smrtnyk
Copy link
Author

Smrtnyk commented Oct 6, 2022

@kdy1 I have updated the repro
you just need to clone, npm install and do npm run transpile
it uses @swc/cli
you can see in transpiled output two same variables called _config

for the inputs forms, you want me to put in the code content from the repro?
when I edit the issue I don't see form inputs anymore

@kdy1
Copy link
Member

kdy1 commented Oct 6, 2022

Closing as duplicate of #5068

@kdy1 kdy1 closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2022
@swc-bot
Copy link
Collaborator

swc-bot commented Nov 5, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Nov 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

3 participants