Haul: symbolicateMiddleware fails when platform is set to all

Created on 20 Jun 2017  Â·  8Comments  Â·  Source: callstack/haul

Current Behavior

When running haul start --platform all, symbolicateMiddleware throws whenever a log message is inspected.

TypeError: Cannot read property 'output' of undefined
    at createSourceMapConsumer (<redacted>/node_modules/haul-cli/src/server/middleware/symbolicateMiddleware.js:41:30)
    at symbolicateMiddleware (<redacted>/node_modules/haul-cli/src/server/middleware/symbolicateMiddleware.js:97:22)
    at Layer.handle [as handle_request] (<redacted>/node_modules/haul-cli/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (<redacted>/node_modules/haul-cli/node_modules/express/lib/router/index.js:317:13)
    at <redacted>/node_modules/haul-cli/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (<redacted>/node_modules/haul-cli/node_modules/express/lib/router/index.js:335:12)
    at next (<redacted>/node_modules/haul-cli/node_modules/express/lib/router/index.js:275:10)
    at statusPageMiddleware (<redacted>/node_modules/haul-cli/src/server/middleware/statusPageMiddleware.js:16:3)
    at Layer.handle [as handle_request] (<redacted>/node_modules/haul-cli/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (<redacted>/node_modules/haul-cli/node_modules/express/lib/router/index.js:317:13)


Expected Behavior

No errors in the console. Either fail gracefully or (ideally) understand which compiler the source map should be loaded from.

The issue appears to be that when platform is all, the compiler passed to the middleware function is a MultiCompiler and contains an array of compilers: one for each platform. This may also be a problem with the other middleware components; I didn't check.

Haul Configuration (webpack.haul.js)


webpack.haul.js

const path = require('path');

module.exports = ({ platform }, defaults) => ({
  entry: `./src/index.${platform}.js`,
  module: {
    ...defaults.module,
    rules: [
      ...defaults.module.rules,
      {
        test: /\.(css|less)$/,
        loaders: [path.join(__dirname, "native-css-loader.js"), 'less-loader', '<redacted>=' + __dirname + '/less-preamble.json'],
      }
    ],
  },
  resolve: {
    ...defaults.resolve,
    modules: [
      "node_modules",
      path.resolve(__dirname, "../../node_modules")
    ]
  },
});

Your Environment

| software | version
| ---------------- | -------
| Haul | 0.6.0-rf
| react-native | 0.44.0
| node | 6.9.1
| npm or yarn | 3.10.8

bug

Most helpful comment

Holy shit it worked!

All 8 comments

Fantastic write up.

We'll have to pass along the platform that comes in with the request (ios or android) to match the proper MultiCompiler entry in that array.

I can do this, but I'm out of town until Friday evening.

Should the gods of hotel wifi favour my cause, I shall tend to this injustice sooner.

Hey @skellock
Are You still on it? I could send PR, if hotel's wifi is not enough :P

Hey, i haven't had time just yet. But it's been weighing-in on my guilt-o-meter tho.

You're welcome to steal it from me, but I can find time this week for sure.

No worries, I'll put myself on hold then :D

Is the issue solved?? Can we close that?

Not OP, but, there is a “close and comment” button down there. I’m gonna click it and see what happens...

Holy shit it worked!

Thanks for the fix!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xareelee picture xareelee  Â·  5Comments

hesyifei picture hesyifei  Â·  4Comments

jurajkrivda picture jurajkrivda  Â·  4Comments

EamonnLaffey picture EamonnLaffey  Â·  5Comments

satya164 picture satya164  Â·  5Comments