Closed spino17 closed 5 months ago
I'm not sure if there's a better way, but what I've had success with is as follows:
npm install json-as
package.json
file manually:
"overrides": {
"assemblyscript": "$assemblyscript"
}
npm install -D visitor-as
The resulting package.json
should have all of the following (with whatever the current versions are):
"dependencies": {
"json-as": "^0.8.4"
},
"devDependencies": {
"assemblyscript": "^0.27.27",
"visitor-as": "^0.11.4"
},
"overrides": {
"assemblyscript": "$assemblyscript"
}
And then, yes - you still need the transform, either on the command line when calling asc
, or in the asconfig.json
.
Yeah installing visitor-as also solved the issue. The docs nowhere mention to install this as well. It will be great if that is included in the docs as well. Much Thanks for the help :), it worked like a charm
I made it so that the end user can install a different version of visitor-as
say if they were targeting AssemblyScript v18.x.x
, they would install an older version for compat. So, that's why you need to install visitor-as
manually.
I try to keep this lib backwards compatible with older versions :)
I installed the
as-json
and tried to build the project withnpm run asbuild
. It is giving below error:FAILURE Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'visitor-as' imported from
.I have followed the instructions of attaching the
--transform
option etc.