needlePlugin in vite causes a problem

when i launch vite with needlePlugin, i cant use ctrl c to kill all the vite processes. there will always be a node.js javascript runtime process left. It becomes normal when i launch without needlePlugin.

This could cause a problem that the browser page cant connect to restarted vite server and it retries infinitely while throwing too many errors so that the page is completely stucked, unless you open a new page.

And there is a finding:

export default defineConfig(async ({ command, mode }) => {
// if the following code exists, the problem exists even without needlePlugin
// but if i use static import it would be fine.
  const { needlePlugins, useGzip, loadConfig } = await import("@needle-tools/engine/plugins/vite/index.js")

Any Help pls?

PS: vite version v7.3.1 @needle-tools/engine: 4.11.5

I’m sorry, I couldn’t find a response but notified the team :exploding_head:

Hi,

which process are you refering to and which errors?

Which OS, Nodejs version and Browser are you using?

Regarding your finding:
The plugin import does nothing by itself (await import(...))

process not killed correctly: vite dev server

os: windows

nodejs version: v22.16.0

browser: chrome

Could you share more details regarding process not killed correctly: vite dev server ? How do you kill the process?

Could you also share which npm version you’re on (npm --version)

the “await import“ does not cause the problem. I tried to await import some other modules it is fine.Only when i await import this needle tool index file it would be wrong

npm: 10.9.2

i used “vite” to start my web app in a windows command tool.

After it is ready, i pressed “ctrl c” to kill the process.

and then i press the keys:

and in the task manager:

normally it would be:

image

and the task manager should be clean:

this result shows when i delete the await import part and not using needlePlugin.

When i static import that and launch with needlePlugin it will still be wrong.

vite errors:

this happens when i mannually killed the process and restart vite

hi marcel~

do you have any ideas about this? Is there any configure i could set or some way around?

Hi sorry I don’t know how to reproduce this issue.

Do you have a commercial license? If so please DM me your invoice id. Thank you!