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

Hangs while searching for module #9

Open
beatscode opened this issue Mar 13, 2017 · 0 comments
Open

Hangs while searching for module #9

beatscode opened this issue Mar 13, 2017 · 0 comments

Comments

@beatscode
Copy link

beatscode commented Mar 13, 2017

I am trying to use an html to jsx converter(https://github.com/littlehaker/html-to-jsx) with motto. I'm trying to run the example code within motto but code keeps looking for a certain "util.js" file.

  • Ran npm init
  • npm install --save html-to-jsx
  • I copied the htmltojsx/example.js to a file called html2jsx.js in my app directory
  • Created the following test in main_test.go
  • Run go test -run=TestNodeIntegration
func TestNodeIntegration(t *testing.T) {

	m := motto.New()
	m.AddPath("node_modules")
	m.AddPath("node_modules/util")
	v, err := m.Run("html2jsx.js")
	if err != nil {
		t.Error(err)
	}

	i, _ := v.ToString()
	fmt.Println(i)
}

I added the following log statement in motto/module.go
Line 128: fmt.Println(name, choices)

Running the test yielded the following code repeated over and over.

util [/Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits/node_modules/util.js /Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits/node_modules/util.json /Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits/node_modules/util node_modules/util.js node_modules/util.json node_modules/util]
node_modules/util/util.js [node_modules/util/util.js]
/Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/support/isBuffer [/Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/support/isBuffer.js /Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/support/isBuffer.json /Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/support/isBuffer]
inherits [/Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits.js /Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits.json /Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits node_modules/inherits.js node_modules/inherits.json node_modules/inherits]
/Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits/inherits.js [/Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits/inherits.js]
util [/Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits/node_modules/util.js /Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits/node_modules/util.json /Users/alex/projects/go/src/com.abc/transpileangulartomithril/node_modules/util/node_modules/inherits/node_modules/util node_modules/util.js node_modules/util.json node_modules/util]
node_modules/util/util.js [node_modules/util/util.js]

Can't find exactly where it is trying to load util. I tried running npm install util but that did not change anything. I was Curious if it is trying to load node module. I saw nodego but could not figure out how to use the nodego environment within motto.

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

1 participant