remix-run / remix

Build Better Websites. Create modern, resilient user experiences with web fundamentals.
https://remix.run
MIT License
30.02k stars 2.53k forks source link

Remix.js is not compatible with Ionic/react #4985

Closed GalO005 closed 1 year ago

GalO005 commented 1 year ago

What version of Remix are you using?

1.9.0

Steps to Reproduce

I created a new Remix app => installed capacitor.js (and running all the process for Ios & android) => installed ionic framework => use some Ionic elements (in root app) such as:

`import { IonContent, IonHeader, IonTitle, IonToolbar } from '@ionic/react';
import {setupIonicReact} from '@ionic/react';
setupIonicReact()`

Expected Behavior

Transpile with success in Remix app

Actual Behavior

I have an issue with "export"(I assume that related to transpile). I installed ionic framework for my Remix app, but I got the following exception: "Unexpected token 'export'" export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';

KerryRitter commented 1 year ago

In general you will have problems with Ionic and server-side rendering because of how Ionic uses web components under the hood.

https://github.com/KerryRitter/nextjs-tailwind-ionic-capacitor-starter/tree/allow-ssr Here's a repo where I tried to get SSR and Ionic working, but in NextJS. Perhaps it can give you some leads. It is a fork of a repo from Max Lynch @ Ionic.

howlettt commented 1 year ago

I ran into this error as well and fixed it by using serverDependenciesToBundle in remix.config.js:

serverDependenciesToBundle: [/.*@ionic.*/, /.*ionicons.*/, /.*@stencil.*/],

Note however after getting past that error I ran into other errors with Ionic/Stencil and server-side rendering which I have yet to find a solution to

bybruno commented 1 year ago

I have made some attempts without success. At the moment, using Ionic with Next.js or Remix, you may find various issues along the way.

Santas commented 1 year ago

Is this still an issue?