You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey everyone, I am trying to work with PGlite in the browser.
I have an Angular web app that loads PGlite from the npm package, as shown in the documentation.
However when the following call is executed: const db = new PGlite()
And the browser tries to load the wasm file from the npm package I get the following errors on the browser console : "Not allowed to load local resource: file:///C:/....../node_modules/@electric-sql/pglite/dist/postgres.wasm" "Not allowed to load local resource: file:///C:/....../node_modules/@electric-sql/pglite/dist/postgres.data" "ERROR Error: Uncaught (in promise): TypeError: Failed to fetch"
Note that I am using Angular's dev server ng serve.
FWIW, I managed to test PGlite on a simple HTML document loaded without a web server into Chrome, by using the CDN module import.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hey everyone, I am trying to work with PGlite in the browser.
I have an Angular web app that loads PGlite from the npm package, as shown in the documentation.
However when the following call is executed:
const db = new PGlite()
And the browser tries to load the wasm file from the npm package I get the following errors on the browser console :
"Not allowed to load local resource: file:///C:/....../node_modules/@electric-sql/pglite/dist/postgres.wasm"
"Not allowed to load local resource: file:///C:/....../node_modules/@electric-sql/pglite/dist/postgres.data"
"ERROR Error: Uncaught (in promise): TypeError: Failed to fetch"
Note that I am using Angular's dev server
ng serve
.FWIW, I managed to test PGlite on a simple HTML document loaded without a web server into Chrome, by using the CDN module import.
Any suggestions are welcome, thank you!
Beta Was this translation helpful? Give feedback.
All reactions