Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to properly package the app #3

Closed
anserwaseem opened this issue Sep 30, 2023 · 9 comments
Closed

how to properly package the app #3

anserwaseem opened this issue Sep 30, 2023 · 9 comments

Comments

@anserwaseem
Copy link

anserwaseem commented Sep 30, 2023

Issue

Are there any other steps to package the app besides this:
yarn package

Folder structure after packaging

image

Error in packaged app

image
@tuliocll
Copy link
Owner

On the post/project I didn't cover the package/release part, just the development.
This error is because you need to include the database.db file in your package and unpack it before use.
Check it on the boilerplate docs here and about the unpack (asarUnpack) option here.

I created a new commit to add this to the project too.

@anserwaseem
Copy link
Author

anserwaseem commented Oct 1, 2023

Thank you, database.db is now included in packaged app but I still get that popup "Error registering user" with false being logged in console,
Additionally, when I try to log in, it throws this error (tried packaging the app on Mac M2 Max and Windows 11; seeing same issues on both systems)

image

Am I missing something here?

@tuliocll
Copy link
Owner

tuliocll commented Oct 1, 2023

Thank you, database.db is now included in packaged app but I still get that popup "Error registering user" with false being logged in console, Additionally, when I try to log in, it throws this error (tried packaging the app on Mac M2 Max and Windows 11; seeing same issues on both systems)

image Am I missing something here?

Are you trying with the new changes? Looks like the database file was not found. It`s a packaged executable or are you running in development?

@anserwaseem
Copy link
Author

Are you trying with the new changes? Looks like the database file was not found. It`s a packaged executable or are you running in development?

Yes, im trying with your latest commit, running packaged executable using this command

image

@tuliocll
Copy link
Owner

tuliocll commented Oct 1, 2023

Are you trying with the new changes? Looks like the database file was not found. It`s a packaged executable or are you running in development?

Yes, im trying with your latest commit, running packaged executable using this command

image

Oh, try without the DEBUG_PROD env. If you enable this you will look for the database in the env path.
I use this to build:

npx cross-env CSC_IDENTITY_AUTO_DISCOVERY=false npm run package --mac

The CSC_IDENTITY_AUTO_DISCOVERY env is to disable the code signing and the --mac to build only for mac.

@anserwaseem
Copy link
Author

anserwaseem commented Oct 1, 2023

Tried this command, still facing issue

I still get that popup "Error registering user" with false being logged in console,
Additionally, when I try to log in, it throws this error (tried packaging the app on Mac M2 Max and Windows 11; seeing same issues on both systems)

I think app is being packaged right but there is some other issue !!
Do I need to run some other command or chores before packaging?

@tuliocll
Copy link
Owner

tuliocll commented Oct 1, 2023

No, i just run this npx cross-env CSC_IDENTITY_AUTO_DISCOVERY=false npm run package --mac and open:
https://github.com/tuliocll/electron-react-sqlite-todo/assets/22357579/fa104b17-9a97-4ccd-a87b-61c9e876bd97

Maybe cache? Try to delete the release/build folder (don't delete the release/app) and run again.

@anserwaseem
Copy link
Author

anserwaseem commented Oct 1, 2023

No, i just run this npx cross-env CSC_IDENTITY_AUTO_DISCOVERY=false npm run package --mac and open: https://github.com/tuliocll/electron-react-sqlite-todo/assets/22357579/fa104b17-9a97-4ccd-a87b-61c9e876bd97

Maybe cache? Try to delete the release/build folder (don't delete the release/app) and run again.

Yes, deleting release/build folder and running npx cross-env CSC_IDENTITY_AUTO_DISCOVERY=false npm run package --Mac worked like a charm!

Thank you so much @tuliocll ❤️

@tuliocll
Copy link
Owner

tuliocll commented Oct 1, 2023

I'm glad I could help.

@tuliocll tuliocll closed this as completed Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants