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
Rspack alias not working as expected #2914
Comments
I would suggest using https://github.com/web-infra-dev/rspack-repro to confirm whether Webpack works as expected. |
@hyf0 I just created two alias scenarios not working in Rspack as expected. I just invited you as a contributor on the repo. In summary, the below scenarios are working in Webpack and not in Rspack.
|
Thank you for taking time to create the repo. It's a bug of Rspack and we plan to fix it. |
@dgmachado Excuse me for the late reply, can you also add me as a contributor? I'll try and unblock this for you during the next week. |
@Boshen sure. I just invited you. |
@dgmachado Your repros are some what confusing for me, you are mixing a few scenarios in different contexts. For your real app, which one is broken? If it's scenario 3 from the first nest repo, I can't replicate it with Webpack. This is done by changing everything to
Notice it's resolved to If it's this example:
It's not going to work because it's not evaluated, did you mean
But this is the not same as scenario as the previous one? I'm getting super confused here. |
@Boshen thanks for the feedback. I just pushed a new commit into the repo repo and branch bug/rspack-alias. In my scenario, I need the below config working as webpack:
You can compare the results by executing the below commands:
|
Thank you for the confirmation, linking to |
Thanks for the report. The issue was caused by a lack of re-doResolve process after normalizing the request. Although it is a bug and needs to be fixed, it can be avoided by using a relative alias key. Therefore, it has been given a low priority. |
This issue has been automatically marked as stale because it has not had recent activity. If this issue is still affecting you, please leave any comment (for example, "bump"). We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
@bvanjoi thank you for the heads up. |
@dgmachado this bug is fixed in new resolver implmentation, you can test by enable new resolver // rspack.config.js
module.exports = {
experiments: {
rspackFuture: {
newResolver: true
}
}
} and you can see a example here https://github.com/hardfist/rspack-absolute-alias/blob/fix-alias/config.mjs#L39 |
System Info
System:
OS: macOS 13.1
CPU: (10) arm64 Apple M1 Pro
Memory 32GB
Shell: /bin/zsh
Binaries:
node: 16.13.2
npm: 9.5.0
yarn: 1.22.19
Browsers:
Chrome: 111.0.5563.146
npmPackages:
@nrwl/rspack: 15.9.5
@rspack/core: ~0.1.0
@rspack/dev-server: ~0.1.0
@rspack/plugin-minify: ~0.1.0
Details
The Rspack alias isn't working as expected. As you can see below only scenario 1 works.
Reproduce link
No response
Reproduce Steps
I've created a sample app you can use the branch "build" and to test you can execute the below commands:
What is expected:
What is appearing:
The text was updated successfully, but these errors were encountered: