Thread: Can't find variable: exports


+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Dec 2011
    Location
    Kalamazoo, MI
    Posts
    12
    Thread score
    -1

    0

    +1

    You must log in to vote for this post.

    Can't find variable: exports

    When I add exports. to my server side functions, I get this error:Click image for larger version

Name:	Screen shot 2012-06-07 at 11.21.55 AM.jpg
Views:	9
Size:	6.9 KB
ID:	562

    Is there something I'm missing? Thanks!

  2. #2
    Moderator Alexandre Morgaut's Avatar
    Join Date
    Apr 2011
    Location
    Vertou, France
    Posts
    793
    Post score
    -1

    0

    +1

    You must log in to vote for this post.

    How did you execute it?

    "exports" exists only when a script is executed via a call from require()
    If it is called from the RPC service, it should be ok (in WAK2 aka "Beta 2")

    If you click on the "run" button of the code editor, "exports" won't exist

    If you want to execute a module for test:
    1 - do it via require from another file or generate
    2 - create e fake exports object
    Code:
    // example of fake exports for test
    if (typeof exports === "undefined") {
        exports = {};
        console.warn('fake exports for test');
    }
    Alexandre Morgaut
    W3C Advisory Committee representative for 4D
    Web Architect & Community manager

  3. #3
    Junior Member
    Join Date
    Dec 2011
    Location
    Kalamazoo, MI
    Posts
    12
    Post score
    -1

    0

    +1

    You must log in to vote for this post.

    I'm getting this error when I try to make an asynchronous RPC call from the client side.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts