You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Internal compiler error in src/compiler.js!
Please create a bug report at https://github.com/emscripten-core/emscripten/issues/
with a log of the build and the input files used to run. Exception message: "TypeError: sig.slice(...).replace is not a function
at addFromLibrary (C:\Develop\emsdk-main\upstream\emscripten\src\jsifier.js:528:57)
at symbolHandler (C:\Develop\emsdk-main\upstream\emscripten\src\jsifier.js:554:16)
at symbolHandler (C:\Develop\emsdk-main\upstream\emscripten\src\jsifier.js:554:16)
at Object.<anonymous> (C:\Develop\emsdk-main\upstream\emscripten\src\compiler.js:102:3
at Module._compile (node:internal/modules/cjs/loader:1196:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1250:10)
at Function.Module._load (node:internal/modules/cjs/loader:909:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:22:47
Maybe check length of sig is greater than 1 character?
Hmm.. but sig.slice(1) should always return a string even if sig is the empty string.
> ''.slice(1).replace(/j/g, 'ii')
''
Which leads me to believe that perhaps sig is perhaps some other type? Can add console.log(sig) and console.log(typeof sig) return before line 528 of jsifier.js?
Good catch. Turns out that one of my sigs was ['iiii'] instead of just 'iiii'. Perhaps there could be a check that sig is a string somewhere to avoid this kind of a compiler error.
Activity
sbc100 commentedon Aug 23, 2023
Hmm.. but
sig.slice(1)should always return a string even if sig is the empty string.Which leads me to believe that perhaps sig is perhaps some other type? Can add
console.log(sig)andconsole.log(typeof sig)return before line 528 ofjsifier.js?sbc100 commentedon Aug 23, 2023
Are you passing your own JS library files? (i.e. are you using
--js-library?). Can you share your full link command?goldwaving commentedon Aug 23, 2023
Good catch. Turns out that one of my sigs was ['iiii'] instead of just 'iiii'. Perhaps there could be a check that sig is a string somewhere to avoid this kind of a compiler error.
sbc100 commentedon Aug 23, 2023
Sounds like a good idea.
Add type checking for all JS library decorators
Add type checking for all JS library decorators
Add type checking for all JS library decorators
Add type checking for all JS library decorators
Add type checking for all JS library decorators
Add type checking for all JS library decorators
Add type checking for all JS library decorators
Add type checking for all JS library decorators
Add type checking for all JS library decorators (#20110)