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.

Haul becomes unresponsive while building - is there a way to enable logging?

See original GitHub issue

Current Behavior

While building for iOS i.e. yarn haul start --platform ios Haul gets stuck at 98% and becomes unresponsive. yarn haul bundle --platform ios on the other hand runs successfully to completion Stuck

I can isolate the offending line of code which causes haul to hang but I’d like to know why. I’ve tried the --verbose flag on the start command but I see no additional output on the console. Is there some way I can see whats happening leading up to the hang?

Expected Behavior

I’d like to get more detail on why we’re hanging

Haul Configuration (webpack.haul.js)

import { createWebpackConfig } from 'haul';
const path = require('path');
const paths = require('./config/paths');
const autoprefixer = require('autoprefixer');
const StatsPlugin = require('stats-webpack-plugin');
let resolveModules = [];
resolveModules.push(path.resolve(__dirname, 'src'));
resolveModules.push(paths.appNodeModules);
resolveModules = resolveModules.concat(paths.nodePaths);
const isProduction = false;

const jsonToSassVars = require('./config/json_to_sass_vars');
const sassVars = jsonToSassVars({
  fontPath: isProduction ? '/home/' : '/',
});

const options = {
  cssModuleNiceNames: true,
};
const cssLoaderConfig = options.cssModuleNiceNames
  ? {
      modules: true,
      localIdentName: '[path]-[name]-[local]-[hash:base64:5]',
    }
  : {
      modules: true,
      '-autoprefixer': true,
    };

// ------------------------------------------------------------
// We use PostCSS for autoprefixing only.
function postcss() {
  return [
    require('stylelint')({
      configFile: paths.stylelintConfig,
    }),
    autoprefixer({
      browsers: [
        '>1%',
        'last 4 versions',
        'Firefox ESR',
        'not ie < 9', // React doesn't support IE8 anyway
      ],
    }),
  ];
}

export default {
  webpack: env => {
    const config = createWebpackConfig({
      entry: `./src/index.${env.platform}.js`,
    })(env);

    if (false)
      config.plugins.push(
        new StatsPlugin('stats.json', {
          chunkModules: true,
          exclude: [/node_modules[\\\/]react/],
        })
      );
    config.module.rules = [
      {
        // typescript
        include: paths.appSrc,
        exclude: [paths.textEngineCompiledSrc, /_pb/, /node_modules/, /\.test/],
        test: /\.tsx?$/,
        use: [
          'cache-loader',
          {
            loader: 'ts-loader',
            options: {
              happyPackMode: true,
            },
          },
        ],
      },
      {
        // kiwi
        test: /\.(kiwi)$/,
        use: 'raw-loader',
        exclude: /node_modules/,
        include: [paths.appSrc],
      },
      {
        // wasm
        type: 'javascript/auto',
        test: /\.wasm$/,
        loader: 'wasm-loader',
      },
      {
        test: /\.(js|jsx)$/,
        include: [
          paths.appSrc,
          paths.fileTypeNodeModule,
          /node_modules\/@react-navigation\//,
          /node_modules\/rn-fetch-blob\//,
        ],
        // Exclude all node_modules EXCEPT for the top-level file-type module,
        // which the maintain has no interest in making browser-compatible
        // https://github.com/sindresorhus/file-type/issues/78
        // Unit tests for regex: https://regex101.com/r/fUZJlR/7/tests
        exclude: [paths.textEngineCompiledSrc, /_pb/],
        use: [
          // cacheLoader,
          // threadLoader,
          {
            loader: 'babel-loader',
            options: { cacheDirectory: true },
          },
        ],
      },
      {
        // "postcss" loader applies autoprefixer to our CSS.
        // "css" loader resolves paths in CSS and adds assets as dependencies.
        // "style" loader turns CSS into JS modules that inject <style> tags.
        // In production, we use a plugin to extract that CSS to a file, but
        // in development "style" loader enables hot editing of CSS..
        test: /\.css$/,
        use: [
          'style-loader',
          'css-loader?importLoaders=1',
          {
            loader: 'postcss-loader',
            options: {
              plugins: postcss,
            },
          },
        ],
      },
      {
        test: /\.scssm$/,
        use: [
          { loader: 'cache-loader' },
          'style-loader',
          {
            loader: 'css-loader',
            options: cssLoaderConfig,
          },
          {
            loader: 'postcss-loader',
            options: {
              plugins: postcss,
            },
          },
          {
            loader: 'sass-loader',
            options: {
              data: sassVars,
            },
          },
        ],
      },
      {
        test: /\.(eot|otf|ttf|woff|woff2)(\?.*)?$/,
        loader: 'ignore-loader',
      },

      ...config.module.rules,
    ];

    config.resolve.extensions = [
      `.${env.platform}.ts`,
      '.native.ts',
      `.${env.platform}.tsx`,
      '.native.tsx',
      '.ts',
      '.tsx',
      ...config.resolve.extensions,
    ];
    config.resolve = { modules: resolveModules, ...config.resolve };
    config.node = {
      fs: 'empty',
      net: 'empty',
      tls: 'empty',
      ...config.node,
    };
    // config.mode = 'development';
    config.optimization = {
      minimize: false,
      removeAvailableModules: false,
      removeEmptyChunks: false,
      splitChunks: false,
    };

    return config;
  },
};

Your Environment

software version
Haul 1.0.0-rc.10
react-native 0.57.7
node v8.12.0
npm or yarn 1.9.2

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:4
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
zamotanycommented, Jul 16, 2019

This shouldn’t be an issue on the next branch where we’re doing a revamp of Haul. If you’re using RN 0.59 or 0.60 go check it out - it’s much more stable.

0reactions
zamotanycommented, Aug 1, 2019

If anyone is having this issue please use @haul-bundler/cli (if not already using) and feel free to open a new issue or reopen this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio UI unresponsive when too much build log output ...
Rebuild the project, note that Visual Studio UI becomes unresponsive during the build, and the build takes a very long time to complete....
Read more >
Issue Tracker - Grounded - Obsidian Entertainment
Fixed on Live Audio logs sound muffled when you listen to them in the underwater labs. Fixed on Live Bugs are sliding on...
Read more >
Customizing Logging Behavior While Debugging
See , which shows how to enable debug-level logging for a subsystem. Use the log tool's status argument to check the current logging...
Read more >
ELD List - ELD - Electronic Logging Devices
The listed devices are self-certified by the manufacturer. The Federal Motor Carrier Safety Administration does not endorse any electronic logging devices.
Read more >
Troubleshooting a Linux server: First five things to do | HPE
The first 5 things to do when your Linux server keels over ... Digital Ocean's "How to View and Configure Linux Logs on...
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

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