Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

[Bug]: plugin breaks decorators compilation #18

Open
vvysokiy opened this issue Jan 11, 2023 · 3 comments
Open

[Bug]: plugin breaks decorators compilation #18

vvysokiy opened this issue Jan 11, 2023 · 3 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@vvysokiy
Copy link

vvysokiy commented Jan 11, 2023

Description

Example: https://github.com/vvysokiy/swc-jest-decorators

Correct compiled code - playground link

Config .swcrc

{
  "$schema": "https://json.schemastore.org/swcrc",
  "sourceMaps": true,
  "jsc": {
    "target": "es2020",
    "loose": true,
    "externalHelpers": true,
    "keepClassNames": false,
    "parser": {
      "syntax": "typescript",
      "tsx": true,
      "decorators": true,
      "dynamicImport": true
    },
    "transform": {
      "legacyDecorator": true,
      "decoratorMetadata": true,
      "react": {
        "runtime": "automatic"
      }
    },
    "experimental": {
      "plugins": [
        [
          "@effector/swc-plugin",
          {}
        ]
      ]
    },
    "minify": {
      "mangle": false,
      "compress": false
    }
  },
  "minify": false,
  "module": {
    "type": "commonjs",
    "strict": true,
    "strictMode": true,
    "lazy": true,
    "noInterop": false
  }
}

Versions

"@effector/swc-plugin": "0.0.8",
"@effector/swc-plugin": "0.0.7"

Device

  • MacBook Air M1
  • macOS 12.2.1 (21D62); Darwin 21.3.0
@Drevoed
Copy link
Collaborator

Drevoed commented Jan 13, 2023

Thanks for the issue, will look into it 👍

@sergeysova sergeysova added the bug Something isn't working label Jan 13, 2023
@Drevoed Drevoed added this to the v0.0.10 milestone Jan 20, 2023
@Drevoed
Copy link
Collaborator

Drevoed commented Jan 24, 2023

Can you try this again with v0.0.9?

@vvysokiy

@vvysokiy
Copy link
Author

@Drevoed

 RUNS  tests/test.spec.ts
thread '<unnamed>' panicked at 'position 0 does not resolve to a source location', /Users/runner/.cargo/registry/src/github.com-1ecc6299db9e FAIL  tests/test.spec.tsrc/source_map.rs:1086:17
  ● Test suite failed to run

    failed to handle: position 0 does not resolve to a source location

      at Compiler.transformSync (node_modules/@swc/core/index.js:241:29)

Test Suites: 1 failed, 1 total

Example

Versions

  • "@effector/swc-plugin": "0.0.9",

Device

  • MacBook Air M1
  • macOS 12.2.1 (21D62); Darwin 21.3.0

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

No branches or pull requests

3 participants