Read the doc: https://webpack.js.org/api/module-methods/#import it says that you cant parametrize import. so the name is always a constant in browser..
— You mean the path?
— In a dynamic import?
— I mean that it can be dynamic on server side, but not client
— Maybe im wrong
— Webpack runs locally ofc it doesnt work when the complete path is dynamic as webpack needs to create the chunks locally. What does work tho is that you give webpack a partial path like i did. Then it just creates a chunk for every js file in this folder and the variable part of the path can get resolved on client side as every chunk in this folder is already generated