-
Notifications
You must be signed in to change notification settings - Fork 79
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
The duckdb-based data explorer backend doesn't work on windows #5084
Comments
Can you please provide any information from the developer console? |
Here is what I see in the console when opening the file
|
That error usually happens when the file is clicked before the application has fully initialized (I mentioned this in the PR, still haven't sorted out a fix for this problem), but there might be something else on Windows preventing the extension from loading |
It looks like the issue is that the I made the following changes to /* other code */
import { pathToFileURL } from 'url';
class DuckDBInstance {
constructor(readonly db: duckdb.AsyncDuckDB, readonly con: duckdb.AsyncDuckDBConnection) { }
static async create(ctx: vscode.ExtensionContext): Promise<DuckDBInstance> {
// Create the path to the DuckDB WASM bundle. Note that only the EH
// bundle for Node is used for now as we don't support Positron
// extensions running in a browser context yet.
const distPath = join(ctx.extensionPath, 'node_modules', '@duckdb', 'duckdb-wasm', 'dist');
const bundle = {
mainModule: join(distPath, 'duckdb-eh.wasm'),
mainWorker: join(distPath, 'duckdb-node-eh.worker.cjs')
};
// if we're on windows, we need to call pathToFileURL on mainModule and mainWorker
// to get the correct path format
if (process.platform === 'win32') {
bundle.mainModule = pathToFileURL(bundle.mainModule).toString();
bundle.mainWorker = pathToFileURL(bundle.mainWorker).toString();
}
// console.log output
// mainModule: "file:///c:/Users/sharon/positron/extensions/positron-duckdb/node_modules/@duckdb/duckdb-wasm/dist/duckdb-eh.wasm"
// mainWorker: "file:///c:/Users/sharon/positron/extensions/positron-duckdb/node_modules/@duckdb/duckdb-wasm/dist/duckdb-node-eh.worker.cjs"
/* other code */ which gets us past the |
I'm stepping away for a bit but I have some WIP fixes on https://github.com/posit-dev/positron/tree/duckdb-windows-path. One more path issue to fix up, occurs when opening up the parquet file:
|
thanks @sharon-wang ! I am taking a look at this on your branch also and have got my windows environment set up |
@wesm I just pushed some more changes to duckdb-windows-path that look like they might be working! There's still an error re: If the changes on the branch look roughly okay, I can open up a PR for review! |
Sure please go ahead and open a PR and we can refine as needed there! Thank you |
I’ll fix the other error in the PR since I know what is wrong |
Addresses #5084. The extension needed some massaging of file paths on Windows to get the web worker loading and the SQL strings in a format where DuckDB can read the files. I verify that opening files from the command palette works on Windows, so the bug from #5076 appears to only affect macOS for now --------- Co-authored-by: sharon wang <25834218+sharon-wang@users.noreply.github.com>
System details:
Positron and OS details:
Windows 11
2024.11.0-69
Describe the issue:
The new feature from #4963 doesn't work on Windows
Steps to reproduce the issue:
Expected or desired behavior:
File opens in Data Explorer
Were there any error messages in the UI, Output panel, or Developer Tools console?
The text was updated successfully, but these errors were encountered: