• Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Unknown Unknown
    • None
    • Affects Version/s: None
    • Component/s: BSON
    • Labels:
    • Not Needed

      What problem are you facing?

      Build an app with Vite 2, Vue 3 and Realm-js. The BSON dependency causes the build to fail.

      vite build
      
      vite v2.4.2 building for production...
      transforming (9) node_modules/@vue/shared/dist/shared.esm-bundler.js
      <--- Last few GCs --->
      
      [22473:0x104c00000]    46177 ms: Mark-sweep (reduce) 4336.6 (4342.3) -> 4157.9 (4163.7) MB, 1838.0 / 0.0 ms  (average mu = 0.200, current mu = 0.151) allocation failure scavenge might not succeed
      [22473:0x104c00000]    47736 ms: Mark-sweep (reduce) 4157.9 (4163.7) -> 4157.9 (4163.7) MB, 1559.5 / 0.0 ms  (average mu = 0.108, current mu = 0.000) allocation failure scavenge might not succeed
      
      
      <--- JS stacktrace --->
      
      FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
       1: 0x101317585 node::Abort() (.cold.1) [/Users/me/.nvm/versions/node/v14.17.3/bin/node]

      What driver and relevant dependency versions are you using?

      "dependencies": {    
         "realm-web": "^1.3.0",    
         "vue": "^3.1.5"  
      },  
      "devDependencies": {    
         "@vue/compiler-sfc": "^3.1.5",   
         "@vitejs/plugin-vue": "^1.2",    
         "vite": "^2.4.2"  
      }

      Steps to reproduce?

      I pushed a branch here https://github.com/ChaosDeSelva/realm-prototype/tree/bson-test

      I opened an issue with Realm Github here https://github.com/realm/realm-js/issues/3863

      You can pull my branch and do npm i then npm run build

      or

      try to build a project using bson with vite 2.

      <template><p>hello</p></template>
      <script>
      // import * as Realm from 'realm-web'
      import { Long, serialize, deserialize } from 'bson'
      </script>
      

       

      Using Realm-Web on a few projects, great product. Any help is greatly appreciated, thanks!

       

            Assignee:
            Unassigned Unassigned
            Reporter:
            chaosdeselva@gmail.com Jacob Lashley
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: