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

Not working with ESM #110

Open
Vaibhavriju opened this issue Feb 22, 2023 · 1 comment
Open

Not working with ESM #110

Vaibhavriju opened this issue Feb 22, 2023 · 1 comment

Comments

@Vaibhavriju
Copy link

I use ESM rather than CSJ. I get an error saying, "

{"errorMessage":"exports is not defined in ES module scope\nThis file is being treated as an ES module because it has a '.js' file extension and 'C:\Users\vaibh\slsapis\iot\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.","errorType":"ReferenceError","stackTrace":["ReferenceError: exports is not defined in ES module scope","This file is being treated as an ES module because it has a '.js' file extension and 'C:\Users\vaibh\slsapis\iot\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.","at file:///C:/Users/vaibh/slsapis/iot/swagger/swagger-html.js:2:1"]}

"

@kajalj3098
Copy link

there is way around but it is not a solution because you have to keep generateSwaggerOnDeploy: false

serverless-auto-swagger creates a folder named swagger in your repo where you can update the swagger-html.js file as per your requirement but as soon as it will get generateSwaggerOnDeploy true it will update the swagger back to build setting defined in auto-swagger package.

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

2 participants