You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If asc is used to compile multiple files, and one of those files is resolved via --path, then memory set in that file is not persisted. If --path is not used, the memory persists.
I am trying to build a library that exposes some standard functions to the javascript host. However, because the functions exported in the library cannot manipulate any state that the main program has access to, they aren't useful.
My initial suspicion is that the same file is read and parsed twice, with different internal names...
Could it also be related to multiple entrypoints? In the first example (the broken one), I'm compiling two files with asc, and wouldn't those be considered separate entrypoints? In the second example, the first entrypoint is including the second entrypoint, so there's only one entrypoint. Are entrypoints separated in memory?
On second thought, it looks like the cause is the second entry point, because you specify lib/utils/module.ts, which will resolve to a different internal name than that of the utils/module import.
Activity
amoffat commentedon Nov 23, 2024
Some more context:
I am trying to build a library that exposes some standard functions to the javascript host. However, because the functions exported in the library cannot manipulate any state that the main program has access to, they aren't useful.
CountBleck commentedon Nov 23, 2024
My initial suspicion is that the same file is read and parsed twice, with different internal names...
amoffat commentedon Nov 23, 2024
Could it also be related to multiple entrypoints? In the first example (the broken one), I'm compiling two files with
asc, and wouldn't those be considered separate entrypoints? In the second example, the first entrypoint is including the second entrypoint, so there's only one entrypoint. Are entrypoints separated in memory?CountBleck commentedon Nov 23, 2024
Entrypoints are compiled together...I don't think they affect whether this bug occurs.
CountBleck commentedon Dec 17, 2024
On second thought, it looks like the cause is the second entry point, because you specify
lib/utils/module.ts, which will resolve to a different internal name than that of theutils/moduleimport.amoffat commentedon Dec 17, 2024
Is there a way to use
--path(so I can use non-relative imports) and compile thelib/utils/module.tswithout including it as an entrypoint?CountBleck commentedon Dec 17, 2024
Have you tried playing around with
--lib?