Skip to content
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

Error with the Application experimental framework #137

Open
gogson opened this issue Nov 29, 2013 · 4 comments
Open

Error with the Application experimental framework #137

gogson opened this issue Nov 29, 2013 · 4 comments

Comments

@gogson
Copy link

gogson commented Nov 29, 2013

Hi,

I'm trying to upgrade my OPA 0.9.2 project to the 1.1.1 version.

I'm facing an issue when I try to launch my application:

Error: Your toplevel contains value which can't be synchronously computed
    at global.BslCps_topwait (/opt/mlstate/lib/opa/stdlib/opabsl.opp/opabslNodeJsPackage.js:922:7)
    at Object.<anonymous> (/Users/hugolafitte/sandbox/opa/placeloop.exe:4837:21)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:901:3

After investigating the error, it seems that it occurs with the experimental application framework which is used in my project (this file: https://github.com/MLstate/opalang/blob/master/lib/experimental/framework/application.opa)

One of my former colleague tried to fix this problem but can't achieved it.
(see: http://forum.opalang.org/0_459)

As he said, removing this framework would be very painful for us as it is managing our pages creation and routing.

Should I remove this framework ? Or is there any solution ?
Do I have a simple alternative to this framework ?

Thanks

@OpaOnWindowsNow
Copy link
Contributor

Hi, can you post (privately if needed) the surrounding of the guilty line
(in placeloop.exe) ? I remember having used this framework with 1.X
versions using a simple fix.


I'm trying to upgrade my OPA 0.9.2 project to the 1.1.1 version.

I'm facing an issue when I try to launch my application:

Error: Your toplevel contains value which can't be synchronously computed
at global.BslCps_topwait
(/opt/mlstate/lib/opa/stdlib/opabsl.opp/opabslNodeJsPackage.js:922:7)
at Object.
(/Users/hugolafitte/sandbox/opa/placeloop.exe:4837:21)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:901:3

After investigating the error, it seems that it occurs with the
experimental application framework which is used in my project (this file:
https://github.com/MLstate/opalang/blob/master/lib/experimental/framework/application.opa
)

One of my former colleague tried to fix this problem but can't achieved it.
(see: http://forum.opalang.org/0_459)

As he said, removing this framework would be very painful for us as it is
managing our pages creation and routing.

Should I remove this framework ? Or is there any solution ?
Do I have a simple alternative to this framework ?

Thanks


Reply to this email directly or view it on GitHub.

@gogson
Copy link
Author

gogson commented Nov 29, 2013

Here's the line in the OPA exec file:

global.___contact = BslCps_topwait(__v1_make({tl:{nil:js_void},hd:"contact"},__v3_bslcps_update_cont(cont(BslCps_topk),{none:js_void},"_v3_make","File \"src/path.opa\", line 6, characters 16-45, (6:16-6:45 | 116-145)",js_void)));

And here's the src/path.opa file:

  Main = {{
    //TODO: clean me up, useless path
    main =     Page.Handler.make([])
    contact =  Page.Handler.make(["contact"])
    login =    Page.Handler.make(["email"])
    easy_register = Page.Handler.make(["register","easy"])
    register = Page.Handler.make_with(["register", ""], Rule.consume, identity, "")
    register_confirmation = Page.Handler.make(["register","confirmation"])
    valid_account = Page.Handler.make_with(["register","validate", ""], Rule.alphanum_string, identity, "")
    reset_password = Page.Handler.make_with(["reset", ""], Rule.alphanum_string, identity, "")
    remember = Page.Handler.make(["remember"])
    about    = Page.Handler.make(["about"])
    welcome  = Page.Handler.make(["welcome"])
  }}

The error is located on the first line:

    main =     Page.Handler.make([])

but I'm afraid it is related to all my Page.Handler.make uses.

@OpaOnWindowsNow
Copy link
Contributor

try to delay the call to Server.create(handler) (application.OPA on
make_with) using Scheduler.sleep or push
Le 29 nov. 2013 14:02, "Hugo" [email protected] a écrit :

Here's the line in the OPA exec file:

global.contact = BslCpstopwait(
v1_make({tl:{nil:js_void},hd:"contact"},__v3_bslcps_update_cont(cont(BslCps_topk),{none:js_void},"
_v3_make","File "src/path.opa", line 6, characters 16-45, (6:16-6:45 |
116-145)",js_void)));

And here's the src/path.opa file:

Main = {{
//TODO: clean me up, useless path
main = Page.Handler.make([])
contact = Page.Handler.make(["contact"])
login = Page.Handler.make(["email"])
easy_register = Page.Handler.make(["register","easy"])
register = Page.Handler.make_with(["register", ""], Rule.consume, identity, "")
register_confirmation = Page.Handler.make(["register","confirmation"])
valid_account = Page.Handler.make_with(["register","validate", ""], Rule.alphanum_string, identity, "")
reset_password = Page.Handler.make_with(["reset", ""], Rule.alphanum_string, identity, "")
remember = Page.Handler.make(["remember"])
about = Page.Handler.make(["about"])
welcome = Page.Handler.make(["welcome"])
}}

The error is located on the first line:

main =     Page.Handler.make([])

but I'm afraid it is related to all my Page.Handler.make uses.


Reply to this email directly or view it on GitHubhttps://github.com//issues/137#issuecomment-29514980
.

@gogson
Copy link
Author

gogson commented Nov 29, 2013

It didn't help ! Now I am getting multiple runtime error:

TypeError: object is not a function
    at ___create (/Users/hugolafitte/sandbox/opa/placeloop.exe:4715:363)
    at /Users/hugolafitte/sandbox/opa/placeloop.exe:4724:50
    at /opt/mlstate/lib/opa/stdlib/stdlib.qmljs/stdlib.core.rpc.core.opx/main.js:6:178
    at /opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:50:63
    at /opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:48:154
    at global.loop_schedule (/opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:37:262)
    at global.launch_schedule (/opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:38:78)
    at global.push (/opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:32:62)
    at global.return_ (/opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:40:40)
    at global.return_tc (/opt/mlstate/lib/opa/static/opa-js-runtime-cps/main.js:39:88)
Uncaught exception : TypeError: object is not a function

Here's the 4715 line in the exe file:

global.___create = function ___create(a,b){var c;return c = ccont(b,__v4171_an(b)),___flatten_ec6de8cf({tl:{tl:{tl:{nil:js_void},hd:a.path},hd:":"},hd:a.name_prefix},__v3_bslcps_update_cont(ccont(c,__v4172_an(c,js_void)),{some:b},"_v1_String_flatten_ec6de8cf","File \"src/fw/application.opa\", line 457, characters 41-53, (457:41-457:53 | 15026-15038)",js_void))();};

And here's the 457 line of the application.opa file:

Cell.call(state, {create path="{h.name_prefix}:{h.path}"})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants