ionic-team / capacitor-remix-templates

Build native iOS, Android, and Web apps with Capacitor and Remix.run 💿
Other
116 stars 3 forks source link

Problems Running Template #2

Closed aaronksaunders closed 2 years ago

aaronksaunders commented 2 years ago

Since there are no specific instructions provided on how to run this template other than change the directory and run npm install....

That's what I did and this is the output I get when trying to run the application on device

aaronksaunders@Aarons-14MacBookProM1Pro my-ionic-remix-app % ionic cap build 
? What platform would you like to build for? ios
> npm run ionic:build

> ionic:build
> npm run build

> build
> remix build

Building Remix app in production mode...
Built in 154ms
> capacitor sync ios
[capacitor] [error] The web assets directory (./public/build) must contain an index.html file.
[capacitor]         It will be the entry point for the web portion of the Capacitor app.
[ERROR] An error occurred while running subprocess capacitor.

        capacitor sync ios exited with exit code 1.

        Re-running this command with the --verbose flag may provide more information.
aaronksaunders@Aarons-14MacBookProM1Pro my-ionic-remix-app % 
aaronksaunders commented 2 years ago

I think I found my answer here in discord...

https://discord.com/channels/520266681499779082/908091931295375380/963441302979084350

Thomas Vidas (Ionic) — 04/12/2022 I’m writing an article this week describing the limitations but you’ll need to deploy your Remix app somewhere and point your server.url variable in the capacitor.config.ts file to that URL You push some files to the device, but most of it is off device; and that comes with it’s own set of problems. But people have been asking for Remix templates, so I made some 😄

If this is true, it might be helpful to add it to the readme?

mhartington commented 2 years ago

For those like me who are not in the discord, can you post the text content?

aaronksaunders commented 2 years ago

done, also I am not normally in discord either..

thomasvidas commented 2 years ago

Have you changed the server.url variable in your Capacitor config? That error is only thrown by the @capacitor/cli if you don't have a server.url variable set in your config. All of the templates have one set, so that error shouldn't throw

aaronksaunders commented 2 years ago

https://www.loom.com/share/776c609036db4b14b703e9cec599b9f9

thomasvidas commented 2 years ago

Yeah, it seems there is a bit of confusion. You need a server to run Remix as it is a full-stack framework, not a frontend only tool. Whether that's a hosted server on one of the services provided, or a local live-reload server. The npx cap run ios starts the Capacitor app part and points the app to the server, but doesn't start the backend server. You can start it with npx cap sync hooks or making an npm start script that starts a server before running the app.

I can update the README to be a bit clearer that you need a backend server running in order to get these templates working, as well as update the npm start scripts to do that for you.