jovotech / jovo-framework

🔈 The React for Voice and Chat: Build Apps for Alexa, Messenger, Instagram, the Web, and more
https://www.jovo.tech
Apache License 2.0
1.68k stars 309 forks source link

Error mongodb-client-encryption at bundle script #1381

Closed jrglg closed 2 years ago

jrglg commented 2 years ago

I'm submitting a...

Current Behavior

Error thrown at build script:

image

I don't know much about it. Should we add mongodb-client-encryption in MongoDb integration?

I don't know the implications of --external:mongodb-client-encryption

Error Log


> esbuild --bundle --outfile=bundle/index.js --sourcemap --minify --keep-names --platform=node --target=node14 --format=cjs  --external:aws-sdk --external:@oclif/* --external:@jovotech/cli* --external:@alexa/* "src/app.desarrollo.ts"
✘ [ERROR] Could not resolve "mongodb-client-encryption"
    node_modules/.pnpm/mongodb@4.8.0/node_modules/mongodb/lib/utils.js:1126:42:
      1126 │ ... mongodbClientEncryption = require('mongodb-client-encryption');
           ╵                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  You can mark the path "mongodb-client-encryption" as external to exclude it from the bundle, which will remove this error. You can also surround this "require" call with a try/catch block to handle this failure at run-time instead of bundle-time.
1 error
npm ERR! code ELIFECYCLE```

## Your Environment

<!--- Include as many relevant details about the environment where the bug was discovered -->

- Jovo Framework version used: 4.2.20
- Operating System: Win10, Gitlab pipeline, everywhere
jankoenig commented 2 years ago

I would recommend adding --external:mongodb-client-encryption to the bundle script (similar to e.g. --external:aws-sdk)

jankoenig commented 2 years ago

@jrglg did --external:mongodb-client-encryption help? If so, we can add this to the documentation and close this issue. Thanks!

jrglg commented 2 years ago

Yes it worked.

I'll let you know if anything fails in the future

Thank you

El jue., 4 ago. 2022 10:58, Jan König @.***> escribió:

@jrglg https://github.com/jrglg did --external:mongodb-client-encryption help? If so, we can add this to the documentation and close this issue. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/jovotech/jovo-framework/issues/1381#issuecomment-1204967575, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMTE3JGPKHNY7CHL7MKQ3NTVXOA2BANCNFSM54LEWUYQ . You are receiving this because you were mentioned.Message ID: @.***>

jankoenig commented 2 years ago

Thank you @jrglg! I added a note about this to the MongoDb integration docs: https://www.jovo.tech/marketplace/db-mongodb#deployment