Replies: 2 comments 1 reply
-
Please can anyone help me with that? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Thank you very much for your answer |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I am working on a project with ts and ESmodule, so I need to have
" type": "module"
on my package.json, but I get the following error.{"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\tiris\OneDrive\Documentos\Proyectos\sparta-customer-api-serverless\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\tiris\OneDrive\Documentos\Proyectos\sparta-customer-api-serverless\package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.","at file:///C:/Users/tiris/OneDrive/Documentos/Proyectos/sparta-customer-api-serverless/swagger/swagger-html.js:2:1","at ModuleJob.run (node:internal/modules/esm/module_job:198:25)","at async Promise.all (index 0)","at async ESMLoader.import (node:internal/modules/esm/loader:385:24)","at async importModuleDynamicallyWrapper (node:internal/vm/module:437:15)","at async _tryAwaitImport (C:\Users\tiris\OneDrive\Documentos\Proyectos\sparta-customer-api-serverless\node_modules\serverless-offline\src\lambda\handler-runner\in-process-runner\aws-lambda-ric\UserFunction.js:215:14)","at async _tryRequire (C:\Users\tiris\OneDrive\Documentos\Proyectos\sparta-customer-api-serverless\node_modules\serverless-offline\src\lambda\handler-runner\in-process-runner\aws-lambda-ric\UserFunction.js:275:24)","at async _loadUserApp (C:\Users\tiris\OneDrive\Documentos\Proyectos\sparta-customer-api-serverless\node_modules\serverless-offline\src\lambda\handler-runner\in-process-runner\aws-lambda-ric\UserFunction.js:304:14)","at async module.exports.load (C:\Users\tiris\OneDrive\Documentos\Proyectos\sparta-customer-api-serverless\node_modules\serverless-offline\src\lambda\handler-runner\in-process-runner\aws-lambda-ric\UserFunction.js:341:21)"]}
I tried renaming the files but they are generated again. Any idea on how I can run this plugin with ESModule
Beta Was this translation helpful? Give feedback.
All reactions