Skip to content

unable to import from library (ascMain not working?) #1679

Closed
@trusktr

Description

@trusktr

Code is here: lume/glas#111

asc v0.17.7

I believe ascMain is set up correctly, but it doesn't seem to work.

From that example, here is the aswebglue ascMain field pointing to src/WebGL.ts:

https://github.com/lume/ASWebGLue/blob/9499782e0d7b3b9f51bbe3c7238abf0838f51c71/package.json#L4

  "ascMain": "src/WebGL.ts",

Here is src/WebGL.ts which is located exactly where ascMain points to:

https://github.com/lume/ASWebGLue/blob/9499782e0d7b3b9f51bbe3c7238abf0838f51c71/src/WebGL.ts

Here is the file that tries to import stuff from 'aswebglue' but it doesn't work:

https://github.com/lume/glas/blob/8f56ae0bb0d5796d4202fbfab7a352e00bc44600/src/as/test.ts#L2

import {SHORT} from 'aswebglue'

Steps to reproduce:

git clone [email protected]:lume/ASWebGLue.git
cd ASWebGLue
git checkout assemblyscript-issue-1679
cd src/examples/CubeNodejs
npm install
npm start

That will output the following error:

❯ npm start

> @ prestart /home/trusktr/src/battlelinegames+ASWebGLue/src/examples/CubeNodejs
> npm run build


> @ build /home/trusktr/src/battlelinegames+ASWebGLue/src/examples/CubeNodejs
> asc cube.ts -b cube.wasm

ERROR TS6054: File '~lib/aswebglue/src/WebGL.ts' not found.

 import {WebGLRenderingContext, WebGLShader, WebGLProgram} from 'aswebglue/src/WebGL'; // does not work
                                                                ~~~~~~~~~~~~~~~~~~~~~
 in cube.ts(2,64)

FAILURE 1 parse error(s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions