Skip to content
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

npm compat: module imported via .node file is missing exports #17085

Closed
sigmaSd opened this issue Dec 16, 2022 · 3 comments · Fixed by #17320
Closed

npm compat: module imported via .node file is missing exports #17085

sigmaSd opened this issue Dec 16, 2022 · 3 comments · Fixed by #17320
Assignees
Labels
bug Something isn't working node compat node native extension related to the node-api (.node)

Comments

@sigmaSd
Copy link
Contributor

sigmaSd commented Dec 16, 2022

import pl from "npm:nodejs-polars@0.5.4" // latest version that works with deno
df = pl.DataFrame(
     {
         "A": [1, 2, 3, 4, 5],
         "fruits": ["banana", "banana", "apple", "apple", "banana"],
         "B": [5, 4, 3, 2, 1],
         "cars": ["beetle", "audi", "beetle", "beetle", "beetle"],
     }
 )

errors with

Uncaught TypeError: polars_internal_1.default.JsSeries.newOptF64 is not a function
    at Float64 (file:///home/mrcool/.cache/deno/npm/registry.npmjs.org/nodejs-polars/0.5.4/bin/datatypes.js:56:51)
    at arrayToJsSeries (file:///home/mrcool/.cache/deno/npm/registry.npmjs.org/nodejs-polars/0.5.4/bin/internals/construction.js:143:18)
    at SeriesConstructor (file:///home/mrcool/.cache/deno/npm/registry.npmjs.org/nodejs-polars/0.5.4/bin/series/series.js:652:55)
    at file:///home/mrcool/.cache/deno/npm/registry.npmjs.org/nodejs-polars/0.5.4/bin/dataframe.js:604:36
    at Array.map (<anonymous>)
    at objToDF (file:///home/mrcool/.cache/deno/npm/registry.npmjs.org/nodejs-polars/0.5.4/bin/dataframe.js:600:41)
    at Object.DataFrameConstructor [as DataFrame] (file:///home/mrcool/.cache/deno/npm/registry.npmjs.org/nodejs-polars/0.5.4/bin/dataframe.js:597:36)
    at <anonymous>:2:9
@dsherret dsherret changed the title npm compat: nodejs-polars npm compat: module imported via .node file is missing exports Dec 16, 2022
@dsherret dsherret added node native extension related to the node-api (.node) bug Something isn't working node compat labels Dec 16, 2022
@lilnasy
Copy link

lilnasy commented Dec 17, 2022

Ran into the same issue here.

@bartlomieju
Copy link
Member

Note to self: discussed with Divy, this is a bug in our implementation of napi_define_class

@birkskyum
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working node compat node native extension related to the node-api (.node)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants