JairusSW / as-json

The only JSON library you'll need for AssemblyScript. SIMD enabled
MIT License
80 stars 16 forks source link

[ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './transform' is not defined by "exports" #36

Closed Tinche closed 1 year ago

Tinche commented 1 year ago

Hello!

I'm trying to get started with this library, not having too much experience with WASM, AssemblyScript or TypeScript for that matter.

I followed the instructions from the README, but when I invoke asc with "transform": "json-as/transform" in my options, I get the error from the title.

Would be great if you could help me with what I'm doing wrong. Thanks!

JairusSW commented 1 year ago

Hello! You want to invoke asc with the --transform json-as/transform flag, not the JSON k/v pair. Example:

asc assembly/index.ts --target debug --transform json-as/transform
Tinche commented 1 year ago

Sorry I expressed myself unclearly, I tried both unsuccessfully.

I think there might be an issue with my project setup though, another library I needed to import using "../node_modules/x" instead of just x.

JairusSW commented 1 year ago

What version of AssemblyScript are you using? This is happening to me in the latest version.

JairusSW commented 1 year ago

Found the problem. I ran asinit . and it messed with the exports. Releasing with the next version in a few minutes

JairusSW commented 1 year ago

Done.

Tinche commented 1 year ago

Thanks, that solved my issue!