#1250 amberc fails to compile code using variables from import: clause

Closed
opened 4 years ago by Christian · 2 comments

In my Package, I define a variable:

Package
    named: 'Covid19Model'
    imports: {'appTimestamp' -> 'app/timestamp'}
    transport: (AmdPackageTransport namespace: 'amber-covid19view')

But when running grunt after an update, amberc complains:

$ grunt
Running "amdconfig:app" (amdconfig) task

Running "amberc:all" (amberc) task
Reading: src/Covid19Model.st
Reading: src/Covid19view.st
Reading: src/Covid19view-Tests.st
[Error: Compiler error in section:
CoViD19Application methodsFor: 'accessing'

while processing chunk:
programModificationDate
        "<Date>
        creation timestamp of the 'the.js' file"
        "CoViD19 programModificationDate"

        ^Date fromMilliseconds: appTimestamp

Unknown Variable error: appTimestamp is not defined
  at D:\GitHub\CoViD19UI\node_modules\@ambers\sdk\lib\amberc.js:265:36
  at new Promise (<anonymous>:null:null)
  at D:\GitHub\CoViD19UI\node_modules\@ambers\sdk\lib\amberc.js:259:28
  at Array.map (<anonymous>:null:null)
  at D:\GitHub\CoViD19UI\node_modules\@ambers\sdk\lib\amberc.js:258:30
]

Done.

Everything gets loaded and is working though.

In my Package, I define a variable: Package named: 'Covid19Model' imports: {'appTimestamp' -> 'app/timestamp'} transport: (AmdPackageTransport namespace: 'amber-covid19view') But when running ``grunt`` after an update, ``amberc`` complains: $ grunt Running "amdconfig:app" (amdconfig) task Running "amberc:all" (amberc) task Reading: src/Covid19Model.st Reading: src/Covid19view.st Reading: src/Covid19view-Tests.st [Error: Compiler error in section: CoViD19Application methodsFor: 'accessing' while processing chunk: programModificationDate "<Date> creation timestamp of the 'the.js' file" "CoViD19 programModificationDate" ^Date fromMilliseconds: appTimestamp Unknown Variable error: appTimestamp is not defined at D:\GitHub\CoViD19UI\node_modules\@ambers\sdk\lib\amberc.js:265:36 at new Promise (<anonymous>:null:null) at D:\GitHub\CoViD19UI\node_modules\@ambers\sdk\lib\amberc.js:259:28 at Array.map (<anonymous>:null:null) at D:\GitHub\CoViD19UI\node_modules\@ambers\sdk\lib\amberc.js:258:30 ] Done. Everything gets loaded and is working though.
Herby Vojčík commented 4 years ago
Owner

It's working because old compiled code works fine with updated version (just to clarify things, if grunt compile fails for the package, nothing is saved to the disk).

It's working because old compiled code works fine with updated version (just to clarify things, if `grunt` compile fails for the package, nothing is saved to the disk).
Herby Vojčík commented 4 years ago
Owner

976ee5a571

I removed the code which it seems was needed. :-)

976ee5a57118974d1088194c4aa37b4abd7db293 I removed the code which it seems was needed. :-)
Sign in to join this conversation.
No Label
No Milestone
No assignee
2 Participants
Loading...
Cancel
Save
There is no content yet.