I'm trying to use AssemblyScript to build a WebAssembly inference engine for a TensorFlow.js model that I have.
I started with essentially the quickstart AssemblyScript app (which works great) and then simply added @tensorflow/tfjs
to my dependencies:
$ npm install --save @tensorflow/tfjs
and added an import to assembly/index.ts
:
import * as tf from "@tensorflow/tfjs";
This results in an error when I build it:
$ npm run asbuild
> test-assemblyscript@1.0.0 asbuild
> npm run asbuild:untouched && npm run asbuild:optimized
> test-assemblyscript@1.0.0 asbuild:untouched
> asc assembly/index.ts --target debug
ERROR TS6054: File '~lib/@tensorflow/tfjs.ts' not found.
import * as tf from "@tensorflow/tfjs";
~~~~~~~~~~~~~~~~~~
in assembly/index.ts(1,21)
FAILURE 1 parse error(s)
Am I misunderstanding the import syntax? I am puzzled why it would be looking in ~lib for this versus node_modules.