Skip to content

[WIP] Fix dynamic import analysis issue in Vite#32564

Closed
Copilot wants to merge 1 commit intodevfrom
copilot/fix-vite-dynamic-import-warning
Closed

[WIP] Fix dynamic import analysis issue in Vite#32564
Copilot wants to merge 1 commit intodevfrom
copilot/fix-vite-dynamic-import-warning

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

Thanks for assigning this issue to me. I'm starting to work on it and will keep this PR's description up to date as I form a plan and make progress.

Original prompt

This section details on the original issue you should resolve

<issue_title>Dynamic import cannot be analyzed by Vite</issue_title>
<issue_description>### Description

The following warning appears in the console after serving a project that uses Three.js addons with Vite:

1:52:39 PM [vite] (client) warning: 
/repo/.angular/cache/20.3.9/project/vite/deps/three_examples_jsm_Addons__js.js
91959 |  async function RapierPhysics() {
91960 |    if (RAPIER === null) {
91961 |      RAPIER = await import(`${RAPIER_PATH}`);
      |                            ^^^^^^^^^^^^^^^^
91962 |      await RAPIER.init();
91963 |    }
The above dynamic import cannot be analyzed by Vite.
See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.

  Plugin: vite:import-analysis
  File: /repo/.angular/cache/20.3.9/project/vite/deps/three_examples_jsm_Addons__js.js?v=d890a181

As mentioned in the link in the warning there are a few ways we can resolve this warning if there are some acceptable constraints that we can place on the import path.

Looking for feedback on if this warning is resolvable. Thanks!

Reproduction steps

  1. Serve a Three.js application that imports an addon using Vite

Code

import { HDRLoader } from 'three/examples/jsm/Addons.js'

Live example

Difficult to show dev server logs in live example.

Screenshots

No response

Version

r180

Device

Desktop

Browser

No response

OS

MacOS</issue_description>

<agent_instructions>Do not create a PR, just try to help the user.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@mrdoob mrdoob closed this Dec 16, 2025
@mrdoob mrdoob deleted the copilot/fix-vite-dynamic-import-warning branch December 16, 2025 04:51
Copilot AI requested a review from mrdoob December 16, 2025 04:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Dynamic import cannot be analyzed by Vite

2 participants