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.

[Bug]: tsParticles 1.35.1 "TypeError: Cannot read property 'prototype' of undefined"

See original GitHub issue

Contact Details

milo.thurston@oerc.ox.ac.uk

What happened?

When running tests for a Vue.js project tsparticles 1.3.5 causes them all to fail. Here’s an example run: https://github.com/FAIRsharing/fairsharing.github.io/pull/1236/checks?check_run_id=3718631748

It can be seen that version 1.3.5 is installed:

> tsparticles@1.35.1 install /home/runner/work/fairsharing.github.io/fairsharing.github.io/node_modules/particles.vue/node_modules/tsparticles
> node ./scripts/install.js

Using an earlier version (1.26.3) avoids this, but Github insists upon installing 1.3.5 every time despite what the package.json file says:

https://github.com/FAIRsharing/fairsharing.github.io/blob/broken_homepage_links/package.json#L37

Version

1.3.5

Which library are you using?

Vue.js 2.x (particles.vue)

tsParticles Configuration

background: {
          color: {
            value: 'transparent'
          }
        },
        fpsLimit: 60,
        particles: {
          color: {
            value: '#1F8EBF'
          },
          links: {
            color: '#1F8EBF',
            distance: 100,
            enable: true,
            opacity: 0.5,
            width: 2
          },
          collisions: {
            enable: true
          },
          move: {
            direction: 'none',
            enable: true,
            outMode: 'bounce',
            random: false,
            speed: 1,
            straight: false
          },
          number: {
            density: {
              enable: true,
              value_area: 300
            },
            value: 50
          },
          opacity: {
            value: 0.5
          },
          shape: {
            type: null
          },
          size: {
            random: true,
            value: 5
          }
        },
        detectRetina: true
      }
    }

What browsers are you seeing the problem on?

No response

Relevant log output

FAIL  tests/unit/components/Clients/RESTClient.spec.js
  ● RESTClient › can process network errors

    TypeError: Cannot read property 'prototype' of undefined

      at node_modules/tsparticles/Plugins/PolygonMask/pathseg.js:974:31
      at Object.<anonymous> (node_modules/tsparticles/Plugins/PolygonMask/pathseg.js:1532:3)
      at node_modules/tsparticles/Plugins/PolygonMask/plugin.js:53:61
      at loadPolygonMaskPlugin (node_modules/tsparticles/Plugins/PolygonMask/plugin.js:53:13)

Code of Conduct

  • I agree to follow this project’s Code of Conduct

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
matteobrunicommented, Sep 27, 2021

Yes I’ve added a try/catch with a warning on the catch block, so it’s not blocking. Now I can inspect deeply the issue without worrying about time, at least is not blocking anyone server side.

0reactions
knirirrcommented, Sep 27, 2021

Thanks. Testing it locally (still waiting for the Github build) I now see warnings instead of a failure:

    console.warn node_modules/tsparticles/Plugins/PolygonMask/pathseg.js:1535
      An error occurred in tsParticles pathseg polyfill. If the Polygon Mask is not working, please open an issue here: https://github.com/matteobruni/tsparticles TypeError: Cannot read property 'prototype' of undefined
at Web/fairsharing.github.io/node_modules/tsparticles/Plugins/PolygonMask/pathseg.js:975:35
          at Object.<anonymous> (Web/fairsharing.github.io/node_modules/tsparticles/Plugins/PolygonMask/pathseg.js:1537:3)
          at Runtime._execModule (Web/fairsharing.github.io/node_modules/jest-runtime/build/index.js:867:68)
          at Runtime._loadModule (Web/fairsharing.github.io/node_modules/jest-runtime/build/index.js:577:12)
          at Runtime.requireModule (Web/fairsharing.github.io/node_modules/jest-runtime/build/index.js:433:10)
          at Runtime.requireModuleOrMock (Web/fairsharing.github.io/node_modules/jest-runtime/build/index.js:598:21)
          at /Users/milo/Work/Web/fairsharing.github.io/node_modules/tsparticles/Plugins/PolygonMask/plugin.js:52:57
          at processTicksAndRejections (internal/process/task_queues.js:97:5)
          at loadPolygonMaskPlugin (Web/fairsharing.github.io/node_modules/tsparticles/Plugins/PolygonMask/plugin.js:52:9)

The tests pass, though.

Edit: Passing on Github too, but with warnings: https://github.com/FAIRsharing/fairsharing.github.io/pull/1236/checks?check_run_id=3722280863

Read more comments on GitHub >

github_iconTop Results From Across the Web

[TypeError: Cannot read property 'prototype' of undefined] #114
The 'prototype' of undefined error comes from Frisby trying to extend the global Jasmine Object with custom matchers. In Jasmine 2, custom ...
Read more >
"Uncaught TypeError: Cannot read property 'prototype' of ...
But when I run the browser side, I get ' Uncaught TypeError: Cannot read property 'prototype' of undefined' error in bundle.js.
Read more >
Typeerror: Cannot Read Property 'Prototype' Of Undefined
My issue is regardless of the underlying cause that these false positives make it Uncaught TypeError: Cannot read property 'prototype' of undefined This...
Read more >
tsparticles - UNPKG
defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";var e,t,r,i,o,a,s={} ...
Read more >
Karma - TypeError: Cannot read property 'on' of undefined ...
At the same time, your error handler does not take effect. You need to register error handlers before their potential application, i.e.: gulp.task('unit-test', ......
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

No results found

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