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

jsc.paths following symlinks under bazel when it should not #9344

Closed
Aghassi opened this issue Jul 29, 2024 · 1 comment
Closed

jsc.paths following symlinks under bazel when it should not #9344

Aghassi opened this issue Jul 29, 2024 · 1 comment

Comments

@Aghassi
Copy link

Aghassi commented Jul 29, 2024

Describe the bug

This has been filed before via #8757 and tracked here aspect-build/rules_swc#216 (comment). Namely, when using jsc.paths with baseURL equal to . the swc transform follows the symlink too far and creates a very deeply traversed path. I don't have much useful information beyond that, just that I would expect a string replace and not a full path resolution which includes a symlink.

Input code

No response

Config

{
  "$schema": "https://json.schemastore.org/swcrc",
  "sourceMaps": "inline",
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": true
    },
    "target": "es2022",
    "transform": {
      "react": {
        "runtime": "automatic"
      },
      "hidden": {
        "jest": true
      }
    },
    "baseUrl": ".",
    "paths": {
      "@webpack-aliases/css": ["src/client/css/index.js"]
    }
  },
  "module": {
    "type": "es6"
  },
  "isModule": true,
  "minify": false
}


### Playground link (or link to the minimal reproduction)

None from the playground because I can't repro it in the playwground

### SWC Info output

_No response_

### Expected behavior

I'd expect under bazel and rules_swc that this symlink resolve correctly as it would outside. But right now it seems not to be. 

### Actual behavior

The path injected into the transformed code has `../../../private/var` in it when it should just start with `./`

### Version

1.6.6

### Additional context

_No response_
@Aghassi Aghassi added the C-bug label Jul 29, 2024
@Aghassi Aghassi changed the title jsc.paths not following symlinks under bazel jsc.paths following symlinks under bazel when it should not Jul 29, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2024
@kdy1 kdy1 added this to the Planned milestone Jul 30, 2024
@swc-project swc-project unlocked this conversation Jul 30, 2024
@swc-project swc-project deleted a comment from github-actions bot Jul 30, 2024
@kdy1 kdy1 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 30, 2024
@swc-project swc-project locked and limited conversation to collaborators Jul 30, 2024
@kdy1
Copy link
Member

kdy1 commented Jul 30, 2024

Please provide a minimal reproduction

@kdy1 kdy1 modified the milestones: Planned, v1.7.4 Jul 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

No branches or pull requests

2 participants