Packages that use npm aliases will throw errors during compilation
🐛 bug report
Preflight Checklist
- [x] I have read the Contributing Guidelines for this project.
- [x] I agree to follow the Code of Conduct that this project adheres to.
- [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.
Description of the problem
Any usage of npm package aliases will throw the following error in codesandbox
ModuleNotFoundError
Could not find module in path: 'fluentui' relative to '/src/App.js'
How has this issue affected you? What are you trying to accomplish?
Recently SWC started using npm package aliases, which causes this error when running code using the affected version(s) of @swc/helpers. This is tracked in issue https://github.com/swc-project/swc/issues/7843
To Reproduce
Simple repro: https://codesandbox.io/s/admiring-yalow-4hm4rk?file=/src/App.js Repro with @swc/helper - https://codesandbox.io/s/amazing-grass-h57ljv?file=/example.tsx
Link to sandbox: link (optional)
Simple repro: https://codesandbox.io/s/admiring-yalow-4hm4rk?file=/src/App.js Repro with @swc/helper - https://codesandbox.io/s/amazing-grass-h57ljv?file=/example.tsx
Your Environment
| Software | Name/Version |
|---|---|
| Сodesandbox | Browser version |
| Browser | Chrome and Edge |
| Operating System | Windows |
@ling1726 Have you found a way to get npm aliases to work?
Any updates on this issue? Not being able to install multiple versions of the same npm package is quite limiting.