swagger-jsdoc
swagger-jsdoc copied to clipboard
Cannot use import statement outside a module
Describe the bug [email protected]
To Reproduce Steps to reproduce the behavior:
- install
- config swagger with swagger-jsdoc
- start the server
- See error
Screenshots
/node-boilerplate//node_modules/swagger-jsdoc/index.js:1
import { prepare, extract, organize, finalize } from './src/specification.js';
^^^^^^
SyntaxError: Cannot use import statement outside a module
at Module._compile (internal/modules/cjs/loader.js:895:18)
at Module._compile (/node-boilerplate/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:995:10)
at Object.newLoader [as .js] (/node-boilerplate/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:815:32)
at Function.Module._load (internal/modules/cjs/loader.js:727:14)
at Module.require (internal/modules/cjs/loader.js:852:19)
at require (internal/modules/cjs/helpers.js:74:18)
same for me...
same issue.
yes, i also got this error, does anyone know how to fix?
Why would you convert cjs module to es when it is probably designed to be used with node where majority of stuff is cjs?
I also faced the same Issue. I solved this issue temporarily by downgrading the version from v7 to v6 using npm i [email protected]
@rahulmathews thank you, it also solved this for me
plz fix
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.