Phaser3 dynamically load scene

i try to load the scene dynamically in vite.

  1. first, i’ve removed scenes from the game config

  2. So these scene aren’t builded (They have no relations)
    but i added a specific input build entry. So they do build these scenes.

  3. Going back to the game, if i click the target game button, it dynamically import the scene.
    after adding the scene, it start the scene,

image

It works on the localhost but after i try this in the build version, it causes an error like this.

home.js:1 Uncaught (in promise) TypeError: Failed to resolve module specifier

Is there anything i did wrong? Thank you!

actually in the localhost, i didn’t deal with the builded js file.