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

[Bug]: Compile Warning: #2537

Closed
whisper540 opened this issue Jun 7, 2024 · 1 comment
Closed

[Bug]: Compile Warning: #2537

whisper540 opened this issue Jun 7, 2024 · 1 comment
Labels
🐞 bug Something isn't working

Comments

@whisper540
Copy link

Version

macos

Details

when i use like this:
lazy(()=>import(route.component)

ready Client compiled in 0.22 s
warn Compile Warning:
File: /Users/dkal/workshop/rspack/ino-quick-pro-over-inocube/src/router/routerPaser.tsx:1:1
⚠ Module parse warning:
╰─▶ ⚠ Critical dependency: the request of a dependency is an expression
╭─[52:1]
52 │ finalRoutes.map((route)=>{
53 │ if (Array.isArray(route.children)) menuToRouter(route.children);
54 │ else route.element = lazyLoad(/#PURE/ lazy(()=>import(route.component)));
· ────────────────
55 │ });
56 │ return routes;

Reproduce link

compile no support import(var)

Reproduce Steps

pnpm run dev

@whisper540 whisper540 added the 🐞 bug Something isn't working label Jun 7, 2024
@chenjiahan
Copy link
Member

Rspack does not support to use a fully dynamic import statement, such as import(foo).

See: https://www.rspack.dev/api/modules/module-methods#dynamic-expressions-in-import

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants