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

When using @swc/helpers with @swc/core 1.3.79, the build output path has added node_modules. #7863

Closed
hi-otto opened this issue Aug 25, 2023 · 7 comments · Fixed by #7866
Closed
Assignees
Labels
Milestone

Comments

@hi-otto
Copy link

hi-otto commented Aug 25, 2023

Describe the bug

I have provided a minimal demo for reproduction in the following repository:
https://github.com/hi-otto/swc-1.3.79-bug

Input code

import test from '~/util/test';

class X {

}

console.log(test, X);

Config

{
  "jsc": {
    "parser": {
      "syntax": "typescript",
      "tsx": true
    },
    "baseUrl": ".",
    "paths": {
      "~/*": [
        "./src/*"
      ]
    },
    "externalHelpers": true
  }
}

Playground link

https://github.com/hi-otto/swc-1.3.79-bug

Expected behavior

why 1.3.79 add node_modules before @swc/helpers

dist-1.3.78/index.js

import { _ as _class_call_check } from "@swc/helpers/_/_class_call_check";
import test from "./util/test";
var X = function X() {
    "use strict";
    _class_call_check(this, X);
};
console.log(test, X);

dist-1.3.79/index.js

import { _ as _class_call_check } from "node_modules/@swc/helpers/esm/_class_call_check";
import test from "./util/test";
var X = function X() {
    "use strict";
    _class_call_check(this, X);
};
console.log(test, X);

Actual behavior

No response

Version

1.3.79

Additional context

No response

@hi-otto hi-otto added the C-bug label Aug 25, 2023
@kdy1
Copy link
Member

kdy1 commented Aug 25, 2023

Are you using windows?

@thgh
Copy link

thgh commented Aug 25, 2023

v1.3.79 breaks the Payload CMS build. (macos & ubuntu) Probably because tsconfig paths that should not start with node_modules

Error: Cannot find module 'node_modules/payload/config'

@kdy1 kdy1 self-assigned this Aug 25, 2023
@kdy1 kdy1 added this to the Planned milestone Aug 25, 2023
@kdy1
Copy link
Member

kdy1 commented Aug 25, 2023

We need some more integration tests. It works on swc testing system... I filed #7865

@hi-otto
Copy link
Author

hi-otto commented Aug 25, 2023

Are you using windows?

mac

@kdy1
Copy link
Member

kdy1 commented Aug 25, 2023

Let's wait for https://github.com/swc-project/swc/actions/runs/5976742103

@m-numan-munir
Copy link

Ok

@swc-bot
Copy link
Collaborator

swc-bot commented Sep 25, 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 Sep 25, 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.

5 participants