help icon indicating copy to clipboard operation
help copied to clipboard

Dynamic importing stops node

Open jayjxon opened this issue 5 years ago • 3 comments

Details

When I dynamically import a file, it just stops node with no error.

Node.js version

v16.9.1

Example code

Don't know of a minimum reproducible example, but the github repo is here

Operating system

Windows 11

Scope

runtime

Module and version

don't know what you mean by module, but I am using ESM

jayjxon avatar Nov 06 '21 16:11 jayjxon

In which part of the repo you provided does the dynamic import stop the process?

VoltrexKeyva avatar Nov 17 '21 04:11 VoltrexKeyva

here: https://github.com/TheBotlyNoob/principal-discord-bot/blob/main/main.ts#L18-L24

jayjxon avatar Nov 17 '21 19:11 jayjxon

here: https://github.com/TheBotlyNoob/principal-discord-bot/blob/main/main.ts#L18-L24

This happens when you're trying to import something that causes a circular dependency, one or more of your files are importing a file that also imports the file that is being imported from.

You can get an idea of how to fix that from here.

VoltrexKeyva avatar Nov 18 '21 08:11 VoltrexKeyva