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

sql-wasm.wasm not found on Angular PWA when hosting not on server root path #309

Closed
hschindler opened this issue Aug 25, 2022 · 10 comments
Closed

Comments

@hschindler
Copy link

My Anguar PWA ist hosted on https://server/sub-dir.

I had copied the file sql-wasm.wasm to assets. The PWA-App on Web Browser looking for it at url https://server/assets and not at the expected url https://server/sub-dir/assets.

How can I config this?

@jepiqueau
Copy link
Collaborator

@hschindler i assume that you have an index.html at https://server which is the root for your PWA-App and this is the reason why the the plugin is looking at https://server/assets . There is no way to day to configure this. In case you have several PWA-Apps in your https://server you will have only one copy of the wasm file and not one per app so for me nothing wrong.

@hschindler
Copy link
Author

Thanks for the fast response.
My PWA ist hosted on an IIS. All PWAs are on their own path and are own applications. There is no index.html on the root of the IIS.

@hschindler
Copy link
Author

For now, I have solved it with a "rewrite rule" in IIS. A solution that makes it possible without a "rewrite rule" would be desirable.

@jepiqueau
Copy link
Collaborator

@hschindler This has been fixed in jeep-sqlite@1.5.7

@jepiqueau
Copy link
Collaborator

@hschindler in your app do

npm uninstall --save @capacitor-community/sqlite
npm install --save @capacitor-community/sqlite
npx cap sync

check the package.json file of the node_modules/jeep-sqlite it should be 1.5.7
modify the jeep-sqlite call in the html file or in the .ts file by adding the property wasmPath
<jeep-sqlite autoSave="true" wasmPath="/subdir/assets"></jeep-sqlite>
it should now work

@jepiqueau
Copy link
Collaborator

@hschindler Did you test it?

@EMTmcruz
Copy link

EMTmcruz commented Aug 30, 2022

@jepiqueau. I tried and db open was successful but I have "Error: queryAll: no such table" on my query. Localhost working with the same query and table name but my hosting no working. (I´m use db file in my assets)

@jepiqueau
Copy link
Collaborator

@EMTmcruz i assume you work with @hschindler the database does not work directly from the assets use copyFromAssets method and the open a connection to the database and do the query. You should look at the doc and app staters

@hschindler
Copy link
Author

@jepiqueau with jeep-sqlite version 1.5.7 and the wasmPath attribute it works. Thanks for help.

@jepiqueau
Copy link
Collaborator

@hschindler you are welcome

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

3 participants