absurd-sql icon indicating copy to clipboard operation
absurd-sql copied to clipboard

When accessing a project using a domain name, data in absurd-sql cannot be loaded normally

Open xkmy opened this issue 5 months ago • 0 comments

Detailed Description:

I modified the host in Webpack to '0.0.0.0' and used a domain name to access the local service. After initializing the database, creating the orders table, and adding some data, I refreshed the page. Upon refreshing, I re-initialized the database (at this point, the orders table already exists). However, when executing a query, the following error occurred: "Error: no such table: orders" (it seems that the data in IndexedDB is not being properly linked). Nevertheless, subsequent insertions and queries can be executed normally. Could you please explain the cause of this issue and how I can resolve it so that the domain name can be used for proper access? Thank you!

Additional description: When using localhost:8080, no errors occur, and everything works as expected.

I am using the example code from the repository: https://github.com/jlongster/absurd-sql/tree/master/src/examples/fts

Webpack configuration is as follows:

export default { devtool: 'inline-source-map', devServer: { publicPath: '/', allowedHosts: ['.xy.com'], hot: true, port: 8080, host: '0.0.0.0', compress: false }, mode: 'development', resolve: { extensions: ['.js', '.ts', '.tsx', '.json', '.wasm'], fallback: { crypto: false, path: false, fs: false } }, plugins: [new HtmlWebpackPlugin({ template: './src/index.html' })] };

Version Information:

absurd-sql version 0.0.46 @jlongster/sql.js version 1.6.7

Error screenshot: image image

xkmy avatar Aug 29 '24 09:08 xkmy