GithubHelp home page GithubHelp logo

grootpiano / easegress-assemblyscript-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from easegress-io/easegress-assemblyscript-sdk

0.0 0.0 0.0 44 KB

AssemblyScript SDK for Easegress

License: Apache License 2.0

JavaScript 1.58% TypeScript 98.42%

easegress-assemblyscript-sdk's People

Contributors

localvar avatar suchen-sci avatar xmh19936688 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 asbuil 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)
  • 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. But I'm new to TypeScript, so I'm not sure if it is a correct resolution, or maybe I missed some configuration. 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.