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
after compiled: export keyword “char” has been replaced like "_char", but import still use "char" #7237
Comments
Please provide a repro. At least a playground link |
@kdy1 this is my test repro by steps, u can see the problem
show develop tools, result like this then u can see complied code |
1 similar comment
@kdy1 this is my test repro by steps, u can see the problem
show develop tools, result like this then u can see complied code |
Please provide a minimal repro. It's way too large to analyze |
this is a playground link export "char" was complied to Object.defineProperty(exports, "_char", { then, this will cause other module references to "char " not to be found |
Investigation: This is a bug of |
It is a missing part of #7165. |
Thank you! |
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. |
Describe the bug
"@swc/core": "1.3.49"
example
test.js
export function char() { console.log("char====char"); return ""; }
util.js
import { char } from "./test"; char();
complied code:
`"use strict";
webpack_require.r(webpack_exports);
/* harmony export / webpack_require.d(webpack_exports, {
/ harmony export / "_char": () => (/ binding / _char)
/ harmony export */ });
function _char() {
console.log("char====char");
return "";
}
"use strict";
webpack_require.r(webpack_exports);
/* harmony export / webpack_require.d(webpack_exports, {
/ harmony export / });
/ harmony import */ var test__WEBPACK_IMPORTED_MODULE_0_ = webpack_require("./src/test.js");
(0,test__WEBPACK_IMPORTED_MODULE_0_.char)();
`
export keyword “char” has been replaced like "_char", but import still use "char"
Input code
No response
Config
No response
Playground link
No response
Expected behavior
export keyword “char” has been replaced to a new string
import follow the same rule
Actual behavior
No response
Version
1.3.49
Additional context
No response
The text was updated successfully, but these errors were encountered: