question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to run examples in the develop branch?

See original GitHub issue

What command should we use to run an example in the develop branch?

What is wrong?

Examples are throwing errors in the develop branch.

Where does it happen?

In the develop branch.

How do we replicate the issue?

When I try to run any example in node, it’s throwing an error in the develop branch:

$ node examples/javascript/which-letter-simple.js 
.../brain.js/examples/javascript/which-letter-simple.js:1
(function (exports, require, module, __filename, __dirname) { import brain from '../../src';
                                                              ^^^^^^

SyntaxError: Unexpected token import
    at new Script (vm.js:51:7)
    at createScript (vm.js:136:10)
    at Object.runInThisContext (vm.js:197:10)
    at Module._compile (internal/modules/cjs/loader.js:618:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
    at Module.load (internal/modules/cjs/loader.js:566:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
    at Function.Module._load (internal/modules/cjs/loader.js:498:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
    at startup (internal/bootstrap/node.js:201:19)


$ node --version
v9.11.2

Expected behavior

It works fine in the master branch:

$ node examples/which-letter-simple.js 
iterations: 10, training error: 0.23317416631428975
iterations: 20, training error: 0.210598456317468
iterations: 30, training error: 0.17436649541030716
iterations: 40, training error: 0.13409059488488398
iterations: 50, training error: 0.10131207107612829
iterations: 60, training error: 0.07420014998226022
iterations: 70, training error: 0.0518410705540017
iterations: 80, training error: 0.03558307536025094
iterations: 90, training error: 0.025044735270968704
iterations: 100, training error: 0.018431227715397347
iterations: 110, training error: 0.014178778824250277
iterations: 120, training error: 0.011323259386754258
iterations: 130, training error: 0.009319155256412576
iterations: 140, training error: 0.007856361954302204
iterations: 150, training error: 0.0067525114866180585
iterations: 160, training error: 0.005895903210432278
iterations: 170, training error: 0.005215334626081061
a

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

2reactions
robertleeplummerjrcommented, Jul 7, 2019

I was thinking of converting all those import statements to make it so we don’t have to build it. Thoughts?

1reaction
massaronicommented, Jul 8, 2019

Sure thing, I can convert all those imports to require’s.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git Feature Branch Workflow | Atlassian Git Tutorial
A feature branch is a temporary branch used for development or testing purposes. Learn about the best way to manage them using this...
Read more >
4 ways to create a Git branch quickly by example
The easiest way to create a Git branch is to use the branch switch and provide a branch name. The only shortcoming of...
Read more >
How To Use Git Branches - DigitalOcean
You can switch from master<->develop any time you want by running the 'git checkout [BRANCH]' command where [BRANCH] is either master or develop...
Read more >
Basic Branching and Merging - Git SCM
Let's go through a simple example of branching and merging with a workflow that you might use in the real world. You'll follow...
Read more >
How to Use a Git Branch - Hostinger
git branch [new_branch]. Then, we need to move to the newly created development branch. To do this, we will run the following command:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found