evanw / evanw/node-source-map-support
Could multiple lines added to the generated code throw this off?
- Lenguaje dominante
- JavaScript
- Estrellas
- 2.2k
- Forks
- 223
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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!
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Lee source-map-consumer.js alrededor de la línea 281 e inspecciona el bundle de Webpack generado con las líneas antepuestas que se muestran en el informe. Reproduce el fallo del stack-trace con y sin esas líneas; el trabajo estará terminado cuando determines si los cambios en el bundle causan la columna negativa y documentes el hallazgo, o añadas cobertura específica si el repositorio lo permite.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, node.js, webpack
- Área
- tooling
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100