socketsupply / socket-examples

Socket Runtime Examples – see how your favorite front-end framework is used to build cross platform UIs
https://socketsupply.co/guides
MIT License
117 stars 12 forks source link

make CRA work cross-platform #70

Closed chicoxyzzy closed 1 year ago

chicoxyzzy commented 1 year ago

Make PUBLIC_URL environment variable work on all the platforms

chicoxyzzy commented 1 year ago

@lamiazar @wujekbizon can you either try to run the updated app from this branch or follow the instructions in the README.md? I don't have a Windows machine with me.

lamiazar commented 1 year ago

@chicoxyzzy I will test now

lamiazar commented 1 year ago

@chicoxyzzy I'm still getting the same error, I tested that on your branch cross_platform_cra

chicoxyzzy commented 1 year ago

@lamiazar can you try these two ways to run the app and test if any of these work? 1) set PUBLIC_URL=./ && ssc build 2) set PUBLIC=./ && npm run build && ssc run

wujekbizon commented 1 year ago

@chicoxyzzy I tried everything and still got an error

lamiazar commented 1 year ago

The build failed when I run this (I'm getting the same error) --> set PUBLIC_URL=./ && ssc build I'm getting this output for set PUBLIC=./ && npm run build && ssc run


C:\Users\lamia\socket-examples\advanced\create-react-app>set PUBLIC=./ && npm run build && ssc run

> create-react-app@0.1.0 build
> react-scripts build

Creating an optimized production build...
Compiled successfully.

File sizes after gzip:

  46.62 kB  build\static\js\main.1c40095e.js
  1.79 kB   build\static\js\787.62ea5e01.chunk.js
  541 B     build\static\css\main.073c9b0a.css

The project was built assuming it is hosted at ./ /.
You can control this with the homepage field in your package.json.

The build folder is ready to be deployed.

Find out more about deployment here:

  https://cra.link/deployment

• executable not found: C:\Users\lamia\socket-examples\advanced\create-react-app\dist\win\create-react-app-example-dev-v1.0.0\create-react-app-example-dev.exe 5ms
chicoxyzzy commented 1 year ago

Please pull latest changes and try ssc build -r again

lamiazar commented 1 year ago

Please pull latest changes and try ssc build -r again

same error with latest changes

chicoxyzzy commented 1 year ago

image it works for me

chicoxyzzy commented 1 year ago

it even works for both first commit and last commit

chicoxyzzy commented 1 year ago

are you running it from PowerShell?

lamiazar commented 1 year ago

are you running it from PowerShell? no, from command prompt I'll try with PowerShell now

wujekbizon commented 1 year ago

I'm sorry, but it still doesn't work for me, even when using PowerShell. It's not a big deal for me because I'm using create-socket-app anyway.

lamiazar commented 1 year ago

@wujekbizon did you try updating ssc version? @chicoxyzzy has build the app from the latest master.

wujekbizon commented 1 year ago

did you try updating ssc version? @chicoxyzzy has build the app from the latest master.

yes , I'm on the latest one. @lamiazar Is it working for you?

lamiazar commented 1 year ago

yes , I'm on the latest one. Is it working for you? I'm updating ssc now, I have an old version

chicoxyzzy commented 1 year ago

@mribbons can you try ssc build -r for this branch and advanced/create-react-app example too?