GithubHelp home page GithubHelp logo

Comments (7)

idiotWu avatar idiotWu commented on May 20, 2024

What's the error message?

from service-mocker.

ryanzec avatar ryanzec commented on May 20, 2024

The error is in my own code:

Uncaught TypeError: Cannot read property 'number' of undefined

I am just not able to see it unless I close and reopen the inspector.

from service-mocker.

idiotWu avatar idiotWu commented on May 20, 2024

Sorry I couldn't reproduce this issue with my own code. Would you be so kind as to create a repo that reproduce this issue?

from service-mocker.

ryanzec avatar ryanzec commented on May 20, 2024

well it is something that is hard to reproduce, I cleared my cache (which seemly got rid of the error that was happening and now I am see error in the inspector.

I seem to be getting errors when my code is fine and the only thing I can think of in that I am using webpack to generate my server.js file using this config:

{
  module: {
    loaders: [{
      test: /\.js$/,
      loader: 'babel',
      exclude: [
        path.resolve(__dirname, "node_modules")
      ],
      query: {
        presets: ['react', 'es2015-without-strict-loose'],
        plugins: ['static-fs']
      }
    }, {
      test: /\.json$/,
      loader: 'json-loader'
    }]
  },
  entry: {
    '/javascript/mocker/server': './web/app/mocker/server.js'
  },
  devtool: ['source-map'],
  output: {
    path: './web/build',
    publicPath: '/build',
    filename: '[name].js'
  }
}

Is there any reason why I would not be able to use webpack to build my server.js file?

from service-mocker.

ryanzec avatar ryanzec commented on May 20, 2024

well the second time was my fault though not sure about the original issue I reported. I have noticed weird flaky issues when I have had errors my my server.js code and just wanted to mention it (clearer the cache enough times seems to fix it). I know it is hard to debug and flaky issue so I guess you can just close this and then I can re-open / open another if I am able to more reliability able to re-produce the issue.

from service-mocker.

idiotWu avatar idiotWu commented on May 20, 2024

Ah, I got this issue too.

This is because the error is fired during last run. Once the page is reloaded, you won't see the error again unless you repeat the same action that caused it. In other words, the error you see after reopening console in chrome is a kind of outdated message which is not relative to current window context, chrome throws it again just for debugging purpose. You can switch to the Application tab of chrome dev tool to see all error messages in current service worker context.

You can imagine it like you get a runtime error in console (maybe by clicking a button), then you reload the page and the error message is gone because you haven't fired it.

I think we might have nothing to do with this issue, it's just a supposed behavior in chrome as well as other browsers which support service workers. If you retry the same action that causes the failure, you will be able to see it right away in console.


Update: Firefox doesn't seem to throw the old error message after reopening console.

from service-mocker.

idiotWu avatar idiotWu commented on May 20, 2024

A screencast reproduces this issue:

sw

from service-mocker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.