Closed ChaosDeSelva closed 3 years ago
This might help. I am just trying to get it to build, not much else going on in this repo.
@ChaosDeSelva Thanks for reporting and providing the example code! That will be very helpful. We will investigate this and notify you as soon as we have any progress.
@ChaosDeSelva You are correct that the problem lies in the BSON dependency. When I remove realm-web
from the project and only use bson
, the problem persists. We will have to reach out to those responsible and see if we can find a solution.
@takameyer thanks for looking into this, I really appreciate it. I am using realm-js on a few projects, I really like it. Hopefully it is an easy fix for the team. I went over to the BSON github, it redirected me to the mongo node jira. I submitted a ticket https://jira.mongodb.org/browse/NODE-3462 please feel free to make adjustments to the request. I also pushed a BSON branch for the ticket https://github.com/ChaosDeSelva/realm-prototype/tree/bson-test
@ChaosDeSelva I have been in contact with the team responsible for BSON. It appears the devDependency rollup
has a bug relating to this memory issue, and it seems to effect bson
in a meaningful way. (see issue https://github.com/rollup/rollup/issues/4181). We will have to wait until they have fixed this and released an update.
In the meantime, a work around is to apply the following patch to you package-lock.json. This will downgrade rollup
and should fix the issue.
diff --git a/package-lock.json b/package-lock.json
index 6669298..b9fbf0d 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -466,9 +466,9 @@
}
},
"rollup": {
- "version": "2.53.2",
- "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.53.2.tgz",
- "integrity": "sha512-1CtEYuS5CRCzFZ7SNW5528SlDlk4VDXIRGwbm/2POQxA/G4+7/crIqJwkmnj8Q/74hGx4oVlNvh4E1CJQ5hZ6w==",
+ "version": "2.53.1",
+ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.53.1.tgz",
+ "integrity": "sha512-yiTCvcYXZEulNWNlEONOQVlhXA/hgxjelFSjNcrwAAIfYx/xqjSHwqg/cCaWOyFRKr+IQBaXwt723m8tCaIUiw==",
"dev": true,
"requires": {
"fsevents": "~2.3.2"
@takameyer Thanks for the follow up.
The BSON team updated the Jira ticket this morning pointing out rollup pushed a fix this morning. https://github.com/rollup/rollup/releases/tag/v2.53.3
Thanks for the help, I will close this issue. Everything is working for me now using 2.53.3
Goals
Build an app with Vite 2, Vue 3 and Realm-js
Any help is greatly appreciated. I have spent a day fumbling around rollup and vite configs trying to figure something out to make it work with realm because out of the box it is not.
Expected Results
The build is successful, I get something like this,
Actual Results
As soon as I add
vite build stops working. I suspect it has something to do with the BSON dep but I am not sure.
I did export NODE_OPTIONS=--max_old_space_size=16000 that did not help.
Steps to Reproduce
Create a hello world vite and vue app, include realm-js, do npm run build.
if I comment out import * as Realm from "realm-web"; vite will build with success.
Code Sample
App.vue
package.json
vite.config.