Skip to content
This repository has been archived by the owner on Dec 1, 2019. It is now read-only.

Errors not emptied on watch #21

Closed
Keats opened this issue Jun 2, 2015 · 14 comments
Closed

Errors not emptied on watch #21

Keats opened this issue Jun 2, 2015 · 14 comments

Comments

@Keats
Copy link
Contributor

Keats commented Jun 2, 2015

Hello

I'm trying to setup a webpack workflow and am using that loader.
However, when running the webpack-dev-server errors accumulate in between runs ie on every filesave the same error gets pushed to an array I presume and I end up with one error for each time I saved the file.
Any way to cleanup the array or do some dedup?

@Keats
Copy link
Contributor Author

Keats commented Jun 2, 2015

Actually, even new errors gets multiplied by the number of times since last save.
IE i get error 1 twice, make some changes now get error 2 three times

@s-panferov
Copy link
Owner

@Keats could you please show me your webpack config?

@Keats
Copy link
Contributor Author

Keats commented Jun 3, 2015

var path = require('path');
var webpack = require('webpack');


module.exports = {
  devtool: 'eval',
  entry: [
    'webpack-dev-server/client?http://localhost:3000',
    'webpack/hot/only-dev-server',
    './src/app/app.ts'
  ],
  output: {
    path: path.join(__dirname, 'build'),
    filename: 'bundle.js'
  },
  plugins: [
    new webpack.HotModuleReplacementPlugin(),
    new webpack.NoErrorsPlugin()
  ],
  resolve: {
    extensions: ['', '.js', '.ts']
  },
  resolveLoader: {
    modulesDirectories: ['node_modules']
  },
  module: {
    loaders: [
      {
        test: /\.ts$/,
        loaders: ['react-hot', 'awesome-typescript-loader']
      }
    ]
  }
};

And it's started with gulp

gulp.task('webpack:server', function() {
  devServer = new webpackDevServer(devCompiler, {
    contentBase: outputFolder,
    hot: true,
    watchDelay: 100,
    stats: {
      colors: true,
      exclude: ['node_modules']
    }
  });

  devServer.listen(3000, "localhost", function(err) {
    if (err) {
      throw new $.util.PluginError("webpack:server", err);
    }
    $.util.log("Server running on http://localhost:3000");
  });
});

@s-panferov
Copy link
Owner

@Keats please check out v0.5.3

@s-panferov
Copy link
Owner

I've also added an example with react-hot-loader https://github.com/s-panferov/awesome-typescript-loader/tree/master/examples/react-hot

@Keats
Copy link
Contributor Author

Keats commented Jun 5, 2015

After updating, I now get
Module build failed: TypeError: Cannot read property 'compilerOptions' of undefined when running it.

This is my tsconfig.json

{
    "compilerOptions": {
        "noImplicitAny": true,
        "removeComments": true
    }
}

@Keats
Copy link
Contributor Author

Keats commented Jun 5, 2015

Unrelated to that previous issue but how does this differs from https://github.com/jbrantly/ts-loader ? Might be worth putting in the readme

@Keats
Copy link
Contributor Author

Keats commented Jun 5, 2015

For the error above: https://github.com/s-panferov/awesome-typescript-loader/blob/master/src/index.ts#L95-L96 is correct in the ts but not in dist so I'm assuming dist is from a slightly older version

@RomanDidenko
Copy link

+1

@chicoxyzzy
Copy link

Module build failed: TypeError: Cannot read property 'compilerOptions' of undefined

same

@Keats
Copy link
Contributor Author

Keats commented Jun 9, 2015

@s-panferov should be fixed by #24

@s-panferov
Copy link
Owner

Sorry for the delay, I was afk on the weekend. PR was merged, version will be released soon.

@s-panferov
Copy link
Owner

v0.5.4

@Keats
Copy link
Contributor Author

Keats commented Jun 9, 2015

cheers mate, working for me

@Keats Keats closed this as completed Jun 9, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants