Surnet / swagger-jsdoc

Generates swagger/openapi specification based on jsDoc comments and YAML files.
MIT License
1.66k stars 224 forks source link

Critical dependency: the request of a dependency is an expression #366

Closed DavidJakszta closed 9 months ago

DavidJakszta commented 1 year ago

Describe the bug Getting following warning Critical dependency: the request of a dependency is an expression

To Reproduce Follow the tutorial on https://next-swagger-doc.productsway.com/ about generating swagger docs for Nextjs13: Usage #1: next-swagger-doc with Next.js 13

Expected behavior No Warning

Screenshots image

Desktop (please complete the following information):

xHayden commented 11 months ago

It's a problem with loadCjs = require(resolvedPath); in ./node_modules/swagger-jsdoc/src/utils.js. I assume it's because webpack can't figure out what resolvedPath is to make a dependency graph.

After removing the Cjs loader from utils.js and clearing my .next cache, the error went away because the loader was never being used, but this is obviously not a final solution.

stale[bot] commented 9 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

veigajoao commented 9 months ago

Any progress in this issue? Just had the exact same problem here

rostwolke commented 8 months ago

Exactly the same issue here. What @xHayden suggested works for me. But editing swagger-jsdoc in the node_modules directory is not a solution.