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.

Error when adding the 'beforeRecord' event

See original GitHub issue

Hey, I’ve been testing pollyjs in my Ember app, and it worked fine. Later I’ve added the beforeRecord event like this:

    server
      .any()
      .on('beforeRecord', (req, recording) => {
        console.log(recording);
      });

and got this error (it goes away when I remove it):

pollyjs-core.js:2 Uncaught (in promise) TypeError: Cannot assign to read only property 'params' of object '#<l>'
    at pollyjs-core.js:2
    at tryCatch (polyfill.js:6900)
    at Generator.invoke [as _invoke] (polyfill.js:7138)
    at Generator.prototype.(:7357/3066/tests/anonymous function) [as next] (http://localhost:7357/assets/vendor.js:12297:21)
    at t (pollyjs-core.js:2)
    at pollyjs-core.js:2
    at new Promise (<anonymous>)
    at new n (pollyjs-core.js:2)
    at pollyjs-core.js:2
    at pollyjs-core.js:2

(btw it’d be nice if source maps would work when in dev mode, so that it would be easier to debug issues like this)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
piotrpalekcommented, Jun 14, 2018

@jasonmit thanks! works great now 👍 also I agree, the response event makes more sense for this use case 😃

0reactions
jasonmitcommented, Jun 13, 2018

@piotrpalek that error you were seeing about the read-only object should now be fixed on master and will be part of the 0.1.0 release that is going out in a few minutes.

That said, I still believe for your use case you want to use the response event (formerly known as beforeResponse).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Event Not working Properly on Before Record Saved.
I'm trying to add data from landing page with FirstName and LastName. I saw a good tutorial on the community but it is...
Read more >
Before Record Added Event Not Working&#33;&#33; - ASPRunner
Before Record Added Event Not Working!! ... It isn't working and only adds the record once, The first field 'RECORD' is an autoincrement...
Read more >
NetSuite Applications Suite - Before Record Submit Trigger
The Before Record Submit trigger is a server trigger and executes after a user ... A diagram showing typical record events and when...
Read more >
How do I fix the "Registration for this event is not available ...
This error message appears when your privacy settings prevent someone from registering. It's usually found when you're trying to test the event or...
Read more >
Database Form Events - LibreOffice Help
The Before record action event occurs before the current record or record set ... The Error occurred event is activated if an error...
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