[Rollup] Packaging with Rollup messes up exports #15276
Labels
help wanted
help
This issue can likely be resolved in GitHub issues. No bug fixes, features, or docs necessary
Milestone
Prerequisites
Mongoose version
6.11.2
Node.js version
18.20.4
MongoDB version
6.8.0
Operating system
macOS
Operating system version (i.e. 20.04, 11.3, 10)
No response
Issue
We are depending heavily on mongoose on our backend. We're having an issue trying to reuse some of the models in a handler with a seperate rollup config, which should be deployed on lambda.
The resulting single transpiled file should contain all dependencies and export a handler function.
However, when introducing mongoose in the code as a dependency, the exports can not be found anymore. When splitting the mongoose code into a seperate chunk, these files are also
undefined
.Error when single bundle file:
Error when mongoose is bundled seperately:
We're currently experiencing this only with mongoose. For example, bundling Axios in the same file works fine.
Rollup.config.js
:tsconfig.json
:We've tried many different approach but the same problem keeps popping up. Note that our code contains both TS and JS, hence the multiple plugins in our rollup config.
Thanks in advance!
The text was updated successfully, but these errors were encountered: