Error when adding the 'beforeRecord' event
See original GitHub issueHey, 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:
- Created 5 years ago
- Comments:7
Top 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!! - 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@jasonmit thanks! works great now 👍 also I agree, the
response
event makes more sense for this use case 😃@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 asbeforeResponse
).