AssemblyScript/assemblyscript

[asc.js] Error: Asconfig is not valid JSON: asconfig.json

alexsch01 opened this issue · 1 comments

Bug description

Error: Asconfig is not valid JSON: asconfig.json
  at ke (assemblyscript/dist/asc.js:22754:13927)
  at async Object.Me (assemblyscript/dist/asc.js:22754:1741)

Steps to reproduce

  1. mkdir TestProj

  2. cd TestProj

  3. npm install assemblyscript@0.27.29

  4. script.mjs

import asc from 'assemblyscript/asc'

const tsString = 'ANYTHING that is not an empty string'

const cmd = 'module.ts --textFile module.wat --outFile module.wasm --bindings raw -O3 --runtime stub'
const config = {
  readFile: () => tsString,
  writeFile: () => null,
  listFiles: () => null,
}
const options = cmd.split(' ')

asc.main(options, config)
  1. node script.mjs

AssemblyScript version

0.27.29

Not a bug, I think the documentation should clarify when using asc.main that you need to have a file called asconfig.json