darionco / dekkai

Modern and fast, really fast, CSV parser for the browser and node.js
MIT License
37 stars 5 forks source link

Failed to resolve module specifier "webcpu". Relative references must start with either "/", "./", or "../". #10

Open KyGost opened 3 years ago

KyGost commented 3 years ago

Hey, this looks awesome.

Tried to run it in browser but got an error regarding the webcpu module.

I couldn't see a webcpu folder, am I missing something?

KyGost commented 3 years ago

I've been able to get it most of the way to importing (no idea if it'll actually work) by adding the correct extension to all imports, changing references to csv to CSV and removing worker: for the worker import. Last bit seems to be the wasm file. If I set my webserver to give it with Content-Type: application/wasm it complains about it not being javascipt, if I set it to text/javascript; charset=UTF-8 it cannot parse it.

Will give further updates on how I go.

KyGost commented 3 years ago

Disabling the import Worker line and adding the url of the worker to the new worker call fixed the worker. Changing import wasmData from "./wasm/bin/Parser.wasm"; to const wasmData = "./wasm/bin/Parser.wasm"; fixed that.

KyGost commented 3 years ago

Finally I needed to:

I also got Table.fromURL working very simply with:

static async fromURL(url, configuration = null) {
  const string = await fetch(url).then(response => response.text());
  return await this.fromString(string, configuration);
}