can bytenode have like sourcemap ability?
See original GitHub issuei wanna get correct pos from jsc exception,so that i can analyze exception and fix it,thx
this is a exception from jsc
TypeError: undefined is not a function
at /Users/zimengle/Workspace/bytenode/examples/no-module-flag/script.js:1:62
at Script.runInThisContext (vm.js:126:20)
at runBytecode (/Users/zimengle/Workspace/bytenode/index.js:105:17)
at Object.runBytecodeFile (/Users/zimengle/Workspace/bytenode/index.js:167:10)
at Object.<anonymous> (/Users/zimengle/Workspace/bytenode/examples/no-module-flag/main.js:5:10)
at Module._compile (internal/modules/cjs/loader.js:869:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:880:10)
at Module.load (internal/modules/cjs/loader.js:731:32)
at Function.Module._load (internal/modules/cjs/loader.js:644:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:932:10)
this is a exception from js
TypeError: a.like is not a function
at Object.<anonymous> (/Users/zimengle/Workspace/bytenode/examples/no-module-flag/script.js:6:3)
at Module._compile (internal/modules/cjs/loader.js:869:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:880:10)
at Module.load (internal/modules/cjs/loader.js:731:32)
at Function.Module._load (internal/modules/cjs/loader.js:644:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:932:10)
at internal/main/run_main_module.js:17:11
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
can bytenode have like sourcemap ability? · Issue #60
The problem is how we will use that source map. The .jsc files are not text files. It is not possible to use...
Read more >Is there source map support for typescript in node / ...
Is sourceMap support only intended for browser-support? Or can I use it together with node or nodemon? If the latter, how would I...
Read more >How we bypassed bytenode and decompiled Node.js ...
Compile the bytecode into machine code. Run the machine code. To reiterate, scripts look like and are distributed as simple text. Therefore, if ......
Read more >Is it safe to ship JavaScript Source maps to production?
Source maps are basically files generated while building for production that can help revert a combined/minified file back to an original ...
Read more >So you want to make a PostCSS plugin
PostCSS has great sourcemaps support and integration. It can auto-detect the format you expect, read, and output both inline and external maps.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the consideration @OsamaAbbas !
To preface this, i’m a junior developer with not much experience working with source-maps and no real understanding of the mechanics of bytenode, so everything should be taken with a grain of salt!
I currently use webpack to bundle my files and generate source maps. These source maps get uploaded to sentry.io, and subsequently any uncaught errors experienced by users are reported to sentry. With the source maps uploaded, these error reports are accompanied by a useful stack trace & the particular offending line of code, mapped back to src. PFA screenshot [have only included a small portion of the page / stack trace] 😃
Well I can only speak from my POV from this, but for me the usage of sentry.io [and whatever similar tools that must exist to help debugging in production] takes precedence over the security offered by bytenode. That said, it’s entirely possible i’m misunderstanding something - i’m just working with these tools for the first time - maybe the sourcemaps aren’t as useful as I anticipate.
Definitely would be good to get the input from others, as I can imagine that it would be a complex undertaking.
Unfortunately my understanding of sourcemaps & bytenode is not good enough to comment!
This is likely a problem in your source JavaScript, not
bytenode
. Try running the same code but use the source JavaScript file instead of the compiled bytecode file.