Giter Site home page Giter Site logo

Comments (3)

sync-by-unito avatar sync-by-unito commented on July 4, 2024

➤ PM Bot commented:

Jira ticket: RJS-2856

from realm-js.

kraenhansen avatar kraenhansen commented on July 4, 2024

Reproduction Steps
Make an app using Electron-React Boilerplate or Electron-Vite, try installing and using realm in it.

Please provide the exact steps you're taking to reproduce this, making it simpler for us to reproduce. For one thing, I would love to learn if its the bundling of the main or renderer process (or both) that throw this error.

from realm-js.

MihirGrand avatar MihirGrand commented on July 4, 2024

@kraenhansen

  1. git clone —depth 1 —branch main https://github.com/electron-react-boilerplate/electron-react-boilerplate.git realmtest
  2. cd realmtest
  3. npm install
  4. npm i realm@latest --legacy-peer-deps
  5. Replace code in src/renderer/App.tsx with the following (just importing realm and trying to create a new one)
import { MemoryRouter as Router, Routes, Route } from 'react-router-dom';
import icon from '../../assets/icon.svg';
import './App.css';
import { useEffect } from 'react';
import Realm from 'realm';

function Hello() {
  useEffect(() => {
    const realm = new Realm({
      path: 'myrealm.realm',
    });
    console.log(realm.path);
  }, []);
  return (
    <div>
      <div className="Hello">
        <img width="200" alt="icon" src={icon} />
      </div>
    </div>
  );
}

export default function App() {
  return (
    <Router>
      <Routes>
        <Route path="/" element={<Hello />} />
      </Routes>
    </Router>
  );
}


  1. npm start

Output received is

<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:1212/
<i> [webpack-dev-server] On Your Network (IPv4): http://192.168.0.124:1212/
<i> [webpack-dev-server] Content not from webpack is served from 'C:\Users\mihir\realmtest\public' directory
<i> [webpack-dev-server] 404s will fallback to '/index.html'

[electronmon] waiting for a change to restart it
17:49:37.435 > Skip checkForUpdates because application is not packed and dev update config is not forced
17:49:37.444 > checkForUpdatesAndNotify called, downloadPromise is null
<i> [webpack-dev-middleware] wait until bundle finished: /index.html
ERROR in ./src/renderer/App.tsx 8:0-26
Module not found: Error: Package path . is not exported from package C:\Users\mihir\realmtest\node_modules\realm (see exports field in C:\Users\mihir\realmtest\node_modules\realm\package.json)
 @ ./src/renderer/index.tsx 5:0-24 8:17-20

webpack compiled with 1 error
Not rewriting GET /index.html because the path includes a dot (.) character.
[26112:0703/174940.739:ERROR:CONSOLE(2)] "Electron sandboxed_renderer.bundle.js script failed to run", source: node:electron/js2c/sandbox_bundle (2)
[26112:0703/174940.739:ERROR:CONSOLE(2)] "TypeError: object null is not iterable (cannot read property Symbol(Symbol.iterator))", source: node:electron/js2c/sandbox_bundle (2)

from realm-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.