evanw / evanw/node-source-map-support
Could multiple lines added to the generated code throw this off?
- Vorherrschende Sprache
- JavaScript
- Sterne
- 2.2k
- Forks
- 223
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
I'm inserting multiple lines at the top of a Webpack bundle for the sake of making this work when I load the bundle in Meteor, like so:
``` js
require("source-map-support/register");
var Npm = Meteor.__mwrContext__.Npm;
var Assets = Meteor.__mwrContext__.Assets;
delete Meteor.__mwrContext__;
var require = Npm.require;
/******/ (function(modules) { // webpackBootstrap
```
The other lines are hacks that allow me to `require` the bundle (Meteor normally loads all server files via `vm.callInThisContext`. I assume that `source-map-support-will` only work if the file is required in as a module like this (if there's another way, let me know).
However one of my users reported the following error https://github.com/jedwards1211/meteor-webpack-react/issues/86:
```
/node_modules/source-map-support/node_modules/source-map/lib/source-map/source-map-consumer.js:281
W20151007-12:26:26.964(-4)? (STDERR) throw new TypeError('Column must be greater than or equal to 0, got '
W20151007-12:26:26.964(-4)? (STDERR) ^
W20151007-12:26:26.964(-4)? (STDERR) TypeError: Column must be greater than or equal to 0, got -23
W20151007-12:26:26.964(-4)? (STDERR) at SourceMapConsumer_findMapping as _findMapping
```
Could this be caused by the extra lines I added to the top of the bundle? I've read some about how source maps work, but I think you would be more prepared to answer this question than me. Thanks!
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
Lies source-map-consumer.js ungefähr bei Zeile 281 und untersuche das generierte Webpack-Bundle mit den im Bericht gezeigten vorangestellten Zeilen. Reproduziere den Fehler im Stack-Trace mit und ohne diese Zeilen; abgeschlossen bedeutet, festzustellen, ob die Änderungen am Bundle die negative Spalte verursachen, und den Befund zu dokumentieren oder fokussierte Tests hinzuzufügen, falls das Repository dies unterstützt.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, node.js, webpack
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 35/100