Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circular Dependency Issue with useNitroApp Export in nuxt-og-image #178

Open
daver987 opened this issue Mar 16, 2024 · 0 comments
Open

Circular Dependency Issue with useNitroApp Export in nuxt-og-image #178

daver987 opened this issue Mar 16, 2024 · 0 comments

Comments

@daver987
Copy link

I encountered a circular dependency issue while working with the nuxt-og-image module in my Nuxt project. The built projct is getting a runtime error.

Build Warning:

Export "useNitroApp" of module "node_modules/.pnpm/[email protected]/node_modules/nitropack-nightly/dist/runtime/app.mjs" was reexported through module "virtual:#imports" while both modules are dependencies of each other and will end up in different chunks by current Rollup settings. This scenario is not well supported at the moment as it will produce a circular dependency between chunks and will likely lead to broken execution order.

Node.js v20.11.1

Environment:

Nuxt Version: 3.11 nightly
nuxt-og-image Version: 3.0.0-rc.45
nitropack-nightly Version: 2.10.0-28509108.fdf7e70
Node Version: 20.11.1

Error:

node:internal/modules/esm/resolve:853
throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'nitropack' imported from /app/.output/server/index.mjs
at packageResolve (node:internal/modules/esm/resolve:853:9)
at moduleResolve (node:internal/modules/esm/resolve:910:20)
at defaultResolve (node:internal/modules/esm/resolve:1130:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap. (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND'
}

Node.js v20.11.1

Expected Behavior:
The application should correctly resolve and load nitropack as a dependency without throwing runtime errors, allowing the nuxt-og-image module to function as intended.

Actual Behavior:
A runtime error is thrown indicating that the nitropack module cannot be found, leading to a failure in the application's execution.

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

No branches or pull requests

1 participant