question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

can bytenode have like sourcemap ability?

See original GitHub issue

i 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:closed
  • Created 3 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
delewis13commented, Oct 15, 2020

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!

Could you please elaborate on your use-case?

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] 😃

First, do we really need this feature?

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.

What do you think of this approach?

Unfortunately my understanding of sourcemaps & bytenode is not good enough to comment!

Screen Shot 2020-10-15 at 11 05 55 pm

1reaction
s100commented, Jun 5, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found