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

ensure_dynamic_import(path) throws when path contains special characters #11

Closed
sunoru opened this issue Dec 13, 2022 · 1 comment
Closed

Comments

@sunoru
Copy link
Owner

sunoru commented Dec 13, 2022

Such as running REPL in a folder å:

julia> using NodeCall
ERROR: InitError: NodeError: Cannot find module '/home/sunoru/pro/julia-packages/NodeCall/build/å/jl_CCGv56.j'
Require stack:
- /home/sunoru/pro/julia-packages/NodeCall/build/å/noop.js
Stacktrace:
  [1] throw_error(env::NodeCall.NapiTypes.NapiEnv)
    @ NodeCall ~/pro/julia-packages/NodeCall/src/utils.jl:82
  [2] macro expansion
    @ ~/pro/julia-packages/NodeCall/src/utils.jl:46 [inlined]
  [3] (::NodeCall.var"#144#145"{Bool, Nothing, NodeCall.JsFunction{Nothing}})()
    @ NodeCall ~/pro/julia-packages/NodeCall/src/types/functions.jl:35
  [4] #with_result#25
    @ ~/pro/julia-packages/NodeCall/src/eval.jl:12 [inlined]
  [5] with_result
    @ ~/pro/julia-packages/NodeCall/src/eval.jl:11 [inlined]
  [6] #_#143
    @ ~/pro/julia-packages/NodeCall/src/types/functions.jl:14 [inlined]
  [7] ensure_dynamic_import(path::String; context::Nothing)
    @ NodeCall ~/pro/julia-packages/NodeCall/src/import.jl:91
  [8] ensure_dynamic_import (repeats 2 times)
    @ ~/pro/julia-packages/NodeCall/src/import.jl:78 [inlined]
  [9] initialize(env::Nothing; node_args::Vector{String})
    @ NodeCall ~/pro/julia-packages/NodeCall/src/env.jl:56
 [10] initialize (repeats 2 times)
    @ ~/pro/julia-packages/NodeCall/src/env.jl:35 [inlined]
 [11] __init__()
    @ NodeCall ~/pro/julia-packages/NodeCall/src/env.jl:90
during initialization of module NodeCall
@sunoru
Copy link
Owner Author

sunoru commented Dec 13, 2022

It's because strings are not converted correctly into node types. Probably because length is incorrect.

julia> f = node"console.log"
JsFunction{Nothing}: 0x7fa4f2c8a710
julia> f("abc")
abc
julia> f("åbc")
åb
julia> f("å")
�

@sunoru sunoru closed this as completed in 87ec3d0 Dec 13, 2022
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