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

JS build fails for hello world example #67

Closed
dyerw opened this issue Apr 5, 2022 · 3 comments
Closed

JS build fails for hello world example #67

dyerw opened this issue Apr 5, 2022 · 3 comments

Comments

@dyerw
Copy link

dyerw commented Apr 5, 2022

I was following along in the book and wanted to try compiling to JS.

project.lux:

[""
 ["identity" ["my.group" "lux-test" "0.1.0-SNAPSHOT"]
  "repositories" ["https://oss.sonatype.org/content/repositories/snapshots/"
                  "https://oss.sonatype.org/service/local/staging/deploy/maven2/"]
  
  "dependencies" [["com.github.luxlang" "stdlib" "0.6.5" "tar"]]
  "compiler" ["com.github.luxlang" "lux-js" "0.6.5" "jar"]

  "program" "main"]]

source/main.lux

(.using
[library
[lux "*"
 [program {"+" program:}]
 ["[0]" debug]
 [control
  ["[0]" io]]]])

(program: args
(io.io (debug.log! "Hello, world!")))

when I run lux build I get

➜ lux build
[?] Fetching com.github.luxlang:lux-js-0.6.5 from "/Users/williamdyer/.m2/repository"
[O] Found com.github.luxlang:lux-js-0.6.5 at "/Users/williamdyer/.m2/repository"
[?] Fetching com.github.luxlang:stdlib-0.6.5 from "/Users/williamdyer/.m2/repository"
[O] Found com.github.luxlang:stdlib-0.6.5 at "/Users/williamdyer/.m2/repository"
Local successes: 0: "com.github.luxlang:lux-js-0.6.5"
                1: "com.github.luxlang:stdlib-0.6.5"
Local failures: 
Remote successes: 
Remote failures: 
[BUILD STARTED]
/Users/williamdyer/.m2/repository/com/github/luxlang/lux-js/0.6.5/lux-js-0.6.5.jar:1
PK
^

SyntaxError: Invalid or unexpected token
  at Object.compileFunction (node:vm:352:18)
  at wrapSafe (node:internal/modules/cjs/loader:1027:15)
  at Module._compile (node:internal/modules/cjs/loader:1063:27)
  at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
  at Module.load (node:internal/modules/cjs/loader:975:32)
  at Function.Module._load (node:internal/modules/cjs/loader:822:12)
  at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
  at node:internal/main/run_main_module:17:47

Node.js v17.8.0
[BUILD FAILED]

Let me know if you need any other info

@eduardoejp
Copy link
Member

Switch this line:

"compiler" ["com.github.luxlang" "lux-js" "0.6.5" "jar"]

For this one:

"compiler" ["com.github.luxlang" "lux-js" "0.6.5" "js"]

The JS compiler is a .js file meant to be run with Node.

@eduardoejp
Copy link
Member

If you're wondering why there's also a .jar file for lux-js that does absolute nothing, it's because Nexus won't let me release anything unless I can trick it into thinking I'm deploying a Java library, so I need to upload dummy .jar files for the lux-js compiler.

@dyerw
Copy link
Author

dyerw commented Apr 7, 2022

Ah! Thanks!

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