bfanger / svelte-preprocess-react

Seamlessly use React components inside a Svelte app
MIT License
126 stars 6 forks source link

Using this package in a sveltekit SPA(no server) causes a few errors #26

Closed avivash closed 1 year ago

avivash commented 1 year ago

Hi, thanks for making this package, it's great!

I am seeing a couple issues in my sveltekit app when deploying it as an SPA though.

The first issue is a global is not defined error, even though I have

define: {
  global: 'globalThis'
},

inside my vite.config:

image

If i then manually set global = window in my app.html, I get the following require is not defined error even though i have no requires in my code:

image

Any help you can offer would be much appreciated, thanks!

bfanger commented 1 year ago

We dont use require either, im but sure the svelte-preprocess-react package is the culprit.

Does the application build and run without errors if you dont use any of the react components?

avivash commented 1 year ago

@bfanger it looks like it was an issue with the react library i was using. the team who created it is going to work on launching a framework agnostic SDK, so I'll use that moving forward. Closing this for now. Thanks!