We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
require('./util')
goja_nodejs/util/module.go
util.js
This code will show the problem
import ( "github.com/dop251/goja" "github.com/dop251/goja_nodejs/console" "github.com/dop251/goja_nodejs/require" "testing" ) func TestRegistryUtil(t *testing.T) { vm := goja.New() require.NewRegistry().Enable(vm) console.Enable(vm) v, err := vm.RunScript("root.js", "require('./util')") if err != nil { panic(err) } t.Logf("%+v", v.Export()) }
exports.default = "1";
It will print map[format:0x13b84c0] instead of map[default: 1].
map[format:0x13b84c0]
map[default: 1]
The text was updated successfully, but these errors were encountered:
The reason for the error is path.Clean("./util") will return "util" in https://github.com/dop251/goja_nodejs/blob/master/require/resolve.go#L15
path.Clean("./util")
"util"
Sorry, something went wrong.
287d3f3
No branches or pull requests
This code will show the problem
util.js
It will print
map[format:0x13b84c0]
instead ofmap[default: 1]
.The text was updated successfully, but these errors were encountered: