parse-community / parse-react

[EXPERIMENTAL] React, React Native, and React with SSR (e.g. Next.js) packages to interact with Parse Server backend
https://parseplatform.org/
MIT License
69 stars 27 forks source link

Error when bundling the npm distro with Vite. #100

Open hjcafaro opened 2 years ago

hjcafaro commented 2 years ago

When trying to import the @parse/react library using the npm distro and bundling with vite, the import fails with the following error:

inherits.js:9 Uncaught TypeError: Super expression must either be null or a function
    at _inherits (inherits.js:9:11)
    at LiveQueryClient.js:274:18
    at node_modules/parse/lib/browser/LiveQueryClient.js (LiveQueryClient.js:759:1)
    at __require2 (chunk-W7STUX7H.js?v=aa49bf2b:18:50)
    at node_modules/parse/lib/browser/ParseLiveQuery.js (ParseLiveQuery.js:25:47)
    at __require2 (chunk-W7STUX7H.js?v=aa49bf2b:18:50)
    at node_modules/parse/lib/browser/Parse.js (Parse.js:339:19)
    at __require2 (chunk-W7STUX7H.js?v=aa49bf2b:18:50)
    at node_modules/parse/index.js (index.js:1:18)
    at __require2 (chunk-W7STUX7H.js?v=aa49bf2b:18:50)

This is another example of this issue: https://github.com/parse-community/Parse-SDK-JS/issues/1362 from the Parse-sdk-js repo, and the error stems from the same line of code. The following .jsx file will reproduce the issue.

import * as React from 'react';

import { initializeParse } from '@parse/react';

function App() {
  return (
      <h1> Hello</h1>
  );
}

export default App;
ugal1silbo commented 9 months ago

Same for me