-
-
Notifications
You must be signed in to change notification settings - Fork 669
unable to import from library (ascMain not working?) #1679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I was able to reproduce the bug. I found a work around by explicitly declaring the relative path. Looks like its using the LIBRARY_PREFIX path regardless if its a defined as a USER source library by the parser.ts. work around: import {SHORT} from '../../node_modules/aswebglue/src/webgl' |
When I follow the reproduction steps, I get a version of Also, |
The commit hashes to use are above in the OP links. lume/glas repo: 8f56ae0bb0d5796d4202fbfab7a352e00bc44600 aswebglue: 9499782e0d7b3b9f51bbe3c7238abf0838f51c71 If you checkout lume/glas to that hash, you can modify package.json to have the exact hash for the |
@dcodeIO simple reproduction: git clone git@github.com:lume/ASWebGLue.git
cd ASWebGLue
git checkout assemblyscript-issue-1679
cd src/examples/CubeNodejs
npm install
npm start You will see this output:
|
Updated the previous comment, the reproduction is reproducible and won't change. |
Per @trusktr request, I was able to try to import using (Also, as a quick note, I don't require this behavior for my library, just wanted to help @trusktr reporduce, since they had asked 😄 👍 ) |
@trusktr For some reason the second repro also doesn't work on my machine. Can't install glfw-raub or something. Btw, did you try if it works if you remove the |
Yeah, I tried all approaches. @torch2424 listed one approach (direct file post-fixed onto the library name). But it fails on more approaches: // ascMain in some-lib is "src/index.js" which re-exports from "./path/to/direct/foo.ts"
import {foo} from 'some-lib' // error
import {foo} from 'some-lib/src/path/to/direct/foo.ts' // error
// With this one I expect it to read `ascMain` from package.json in the `some-lib/` folder,
// but I wouldn't be surprised if this particular case hasn't been implemented yet, as
// people most likely won't be trying this unless they are working around the original issue.
import {foo} from '../../../node_modules/some-lib' // error
// This one works:
import {foo} from '../../../node_modules/some-lib/src/path/to/direct/foo.ts' // good I didn't try to remove I'm in Linux. Maybe Let me see about making a reproduction with only one dependency. |
ruab doesnt work on my windows or linux machines either. |
…dates * 'interop-with-node' of github.com:lume/ASWebGLue: Use direct file path until AssemblyScript module resolution is fixed (AssemblyScript/assemblyscript#1679) add Node.js example (WIP, something broke) changes for use in Node with webgl-raub
Got the same error... :( |
Hey, @trusktr @torch2424 @ZoeDreams , it seems to be fixed! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in one week if no further activity occurs. Thank you for your contributions! |
There's still an issue, so I continued in #1954 |
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 tosrc/WebGL.ts
:Here is
src/WebGL.ts
which is located exactly whereascMain
points to:Here is the file that tries to
import
stuff from'aswebglue'
but it doesn't work:Steps to reproduce:
That will output the following error:
The text was updated successfully, but these errors were encountered: