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

ts-decorate and ts-metadata helpers not found in Script source type #7118

Closed
JSerFeng opened this issue Mar 22, 2023 · 5 comments · Fixed by #7147
Closed

ts-decorate and ts-metadata helpers not found in Script source type #7118

JSerFeng opened this issue Mar 22, 2023 · 5 comments · Fixed by #7147
Labels
Milestone

Comments

@JSerFeng
Copy link
Contributor

Describe the bug

source type: module

...
var _tsDecorate = require("@swc/helpers/lib/_ts_decorate.js").default;

source type: script

...
var _ts_decorate = require("@swc/helpers").ts_decorate;

require("@swc/helpers").ts_decorate is undefined

Input code

@aaa
class a {

}

Config

{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": true,
      "decorators": true
    },
    "externalHelpers": true,
    "target": "es2022"
  },
  "module": {
    "type": "commonjs"
  },
  "minify": false,
  "isModule": false
}

Playground link

https://play.swc.rs/?version=1.3.41&code=H4sIAAAAAAAAA3NITEzkSs5JLC5WSFSo5uKqBQAgLzirEQAAAA%3D%3D&config=H4sIAAAAAAAAA02OMQ6DMAxFd06BPHeoMvYEXXoIK5gqKCSRbSQixN2b0EC7%2Bf%2F3v%2B2t63uYxMKj38pYREIW4ksXR3JQXIsDmhOJZZcUbidVqUh5ocsayEZGjSyNHGD%2FcqBViQP6J%2FlEV6RBRX6T1lsk5m4MdK0IcxwWT78%2F6y81Z%2BM8xzDJX9IFN%2BbCRvRyLAYnr7N%2BmN3%2BAfGuH6b5AAAA

Expected behavior

ts_decorate is defined

Actual behavior

ts_decorate is undefined

Version

1.3.41

Additional context

No response

@JSerFeng
Copy link
Contributor Author

You can leave this to me 🥰

@kdy1
Copy link
Member

kdy1 commented Mar 28, 2023

Thank you!

@magic-akari
Copy link
Member

This will be fixed in #7147

@JSerFeng
Copy link
Contributor Author

Thanks !

@kdy1 kdy1 added this to the Planned milestone Mar 31, 2023
kdy1 pushed a commit that referenced this issue Mar 31, 2023
@kdy1 kdy1 modified the milestones: Planned, v1.3.45 Apr 4, 2023
@swc-bot
Copy link
Collaborator

swc-bot commented May 4, 2023

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 May 4, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

Successfully merging a pull request may close this issue.

4 participants