Coder Social home page Coder Social logo

easegress-assemblyscript-sdk's People

Contributors

fossabot avatar localvar avatar suchen-sci avatar xmh19936688 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

easegress-assemblyscript-sdk's Issues

asbuild ERROR AS238: Initializer, definitive assignment or nullable type expected.

Describe the bug

Hi there, I got an error when executing the npm run asbuild command in Flash Sale demo.
Here's the error detail:

$ npm run asbuild

> [email protected] asbuild
> npm run asbuild:debug && npm run asbuild:release


> [email protected] asbuild:debug
> asc assembly/index.ts --target debug --use abort=

ERROR AS238: Initializer, definitive assignment or nullable type expected.
    :
 34 │ var programFactory: (params: Map<string, string>)=>Program
    │     ~~~~~~~~~~~~~~
    └─ in ../../easegress-assemblyscript-sdk/easegress/index.ts(34,5)

ERROR AS238: Initializer, definitive assignment or nullable type expected.
    :
 35 │ var program: Program
    │     ~~~~~~~
    └─ in ../../easegress-assemblyscript-sdk/easegress/proxy.ts(35,5)

FAILURE 2 compile error(s)

Version

  • easegress-assemblyscript-sdk: Latest main branch version (fbe70b0)
  • assemblyscript: 0.27.0
  • node: v18.14.0
  • npm: 9.3.1
  • OS: macOS 13.2.1

Additional context

I did some research about ERROR AS238 but got nothing useful.
According to the error message, here's what I tried:

diff --git a/easegress/index.ts b/easegress/index.ts
-var programFactory: (params: Map<string, string>)=>Program
+type ProgramFactory = (params: Map<string, string>)=>Program
+var programFactory: ProgramFactory = (params)=>new Program(params)

diff --git a/easegress/proxy.ts b/easegress/proxy.ts
-var program: Program
+var program = new Program(new Map<string, string>())

After rebuild, then it worked. And on assemblyscript's 0.19.7 version, it also worked fine.
But I'm new to TypeScript, so I'm not sure if it is the best resolution. Need you guy's help. 🤯

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.