Comments (7)
Hi! Thanks for trying out the library! I was just testing the new conditional export support in 0.6.0-beta.1, so it's good to see that it needs improvement.
This results in the following error, and note that it’s importing
esm/arrow1.js
:
To fix the error while using this esm import, you need to await the default export. E.g. https://observablehq.com/@kylebarron/geoparquet-on-the-web#readParquet.
It seems like the top-level
import
condition is taking precedence over thenode
condition…
I'm not super familiar with intricacies of JS bundling; do you have an idea of why that is? Both import
and node
are listed here:
parquet-wasm/templates/package.json
Lines 57 to 71 in 2204f94
I tried to fix this by importing the Node entry explicitly:
Hmm, maybe we should add specific exports for e.g. /node
?
(Related, did you intend to make 0.6.0-beta.1 the latest tag on npm? Or did you intend it to be a prerelease? If so you may want to use the next tag to encourage folks to stay on 0.5.0 until 0.6.0 is out of beta. 🙏)
Oh I didn't know that was possible. I'm less familiar with NPM distribution compared to PyPI, where everything with an alpha or beta tag is considered a pre-release. I guess I need to look at npm publish options.
I'm sick this week but I'll try to improve this usability when I'm healthy!
from parquet-wasm.
To fix the error while using this esm import, you need to await the default export.
Understood, but I’m in Node and I don’t want the esm import — I want the one targeting Node, which isn’t happening based on how the conditional imports are declared in the package.json.
I think that’s because Node itself supports both import and require, and in my case, I’m using type: "module" and hence Node is favoring the “import” conditional over the “node” conditional. Per the conditional exports docs:
Within the "exports" object, key order is significant. During condition matching, earlier entries have higher priority and take precedence over later entries. The general rule is that conditions should be from most specific to least specific in object order.
So I think you probably need something like this but I haven’t tested…
".": {
"node": {
"types": "./node/arrow1.d.ts",
"default": "./node/arrow1.js"
},
"types": "./esm/arrow1.d.ts",
"default": "./esm/arrow1.js"
}
This should cause Node to use the Node-targeted entries, and everything else will use the esm bundle.
P.S. I hope you feel better! 🙏 Thanks for the support. 😁
from parquet-wasm.
I'm unable to reproduce your original issue. With node v20.4.0
{
"dependencies": {
"parquet-wasm": "^0.6.0-beta.1"
}
}
and a tmp.mjs
of
import * as Parquet from "parquet-wasm";
console.log(Parquet)
that seemed to just work.
In any case, I made #414. Are you able to see if that fixes the issues on your end? Or would it be easier if I published a beta.2
for you to test?
from parquet-wasm.
This is still an issue on beta.2.
from parquet-wasm.
Could you test with #414?
from parquet-wasm.
Related Issues (20)
- runtime error while reading large parquet HOT 6
- HEAD-ache requests HOT 2
- Do you have a data processing flowchart for this set? HOT 1
- Update `readParquetFFI` docs to drop the table
- Document that stream API needs polyfill to be used as async iterable HOT 5
- Deprecate arrow2/parquet2
- Try using `ParquetObjectReader` for arrow1 async api HOT 1
- Module '"parquet-wasm/bundler/arrow2"' has no exported member '__wasm' HOT 3
- Group dependabot updates
- Add publish from CI
- Update README documentation HOT 2
- Request batching HOT 22
- bundler version doesn't work in production since 0.4.0-beta.5 HOT 3
- Writing a Date column drops associated time information HOT 1
- Changelog notes: HOT 5
- explore ehttp for request fetching
- import with typescript HOT 3
- Example doesnt work HOT 18
- Cannot read properties of undefined (reading 'fromIPCStream') HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parquet-wasm.