-
Notifications
You must be signed in to change notification settings - Fork 10
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
error on build: "MongoInternals" is not exported by "meteor/mongo" #279
Comments
Here is a repo that reproduces the problem - run
|
Oh, thanks for the heads up on this. 🙌 Meteor-Vite does not currently have full support for Meteor-specific conditional imports. I'm not sure if there's any good way of implementing this behavior due to the way Vite analyzes module dependencies. Refactoring to use Vite's suggested environment-specific conditionals should help indicate to Vite that the module shouldn't be imported on the client.
export async function isoFunc() {
- if (Meteor.isServer) {
+ if (import.meta.env.SSR) {
const { runTransactionWithRetry } = await import('/server/internals.ts')
runTransactionWithRetry()
} else {
console.log('client!');
}
} We may be able to do a find and replace for conditionals like this, though I worry there may be a risk of unwanted/hard-to-debug behavior if it matches something it shouldn't. I'll definitely have a closer look at ways to handle this, at least for the Meteor runtime variables like |
This constant is actually exported by the meteor/mongo package
Sample code:
my package versions:
Meteor version 3.0.4
Vite config:
The error does not happen when starting the server locally
The text was updated successfully, but these errors were encountered: