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

Compiler: Choking on expander.expandModules (Windows) #386

Closed
am11 opened this issue Sep 14, 2014 · 4 comments
Closed

Compiler: Choking on expander.expandModules (Windows) #386

am11 opened this issue Sep 14, 2014 · 4 comments

Comments

@am11
Copy link

am11 commented Sep 14, 2014

Hello!

One of the sweet.js test cases in Web Essentials is failing. WE consumes sweet.js npm as a web-service (srv-sweetjs) to WE's web-server.

Looks like the crash is caused by expander.expandModule at sweet.js: Line 73.

I isolated the reproduction steps by running the following in node.js shell:

> require("sweet.js").compile("var foo = 100;", {filename: "C:\\temp\\test.sjs", sourceMap: true})
TypeError: Object #<Object> has no method 'expose'
    at eval (eval at <anonymous> (C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node_modules\sweet.js\lib\scopedEval.js:16:69), <anonymous>:93:75)
    at expandMacro (C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node_modules\sweet.js\lib\expander.js:1223:18)
    at step (C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node_modules\sweet.js
\lib\expander.js:1613:30)
    at enforest (C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node_modules\sweet.js\lib\expander.js:1751:16)
    at step (C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node_modules\sweet.js\lib\expander.js:1558:42)
    at step (C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node_modules\sweet.js\lib\expander.js:1703:28)
    at enforest (C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node_modules\sweet.js\lib\expander.js:1751:16)
    at expandToTermTree (C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node_modules\sweet.js\lib\expander.js:2009:17)
    at expandTermTreeToFinal (C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node
_modules\sweet.js\lib\expander.js:2285:34)
    at C:\Users\Adeel\Source\Repos\WebEssentials2013\EditorExtensions\Resources\nodejs\tools\node_modules\sweet.js\lib\expander.js:2202:24

Even using the CLI throws the same error on Windows (same woks fine on Ubuntu).

Also, the exception variable throws the same error when I try to console.log(error) like this. Apparently, the object is unreadable.

@disnet
Copy link
Member

disnet commented Sep 15, 2014

What version of node and sweet.js are you running?

@am11
Copy link
Author

am11 commented Sep 16, 2014

Sweetjs: 0.7.1
Nodejs: 0.10.31

C:\temp> node .\node_modules\sweet.js\bin\sjs --version
Sweet.js version: 0.7.1
C:\temp> node -v
v0.10.31
C:\temp>

@disnet
Copy link
Member

disnet commented Mar 28, 2016

I'm mass closing issues due to the release of 1.0 obviating lots of bugs. If you feel this issue is something we still need to address feel free to reopen.

@disnet disnet closed this as completed Mar 28, 2016
@am11
Copy link
Author

am11 commented Mar 31, 2016

I can confirm that this issue is fixed when tested with version 1.0.1.

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

No branches or pull requests

2 participants