First off, thank you for creating this boilerplate project which truly helped me fast-forward on a script idea I had been brewing in my head for a while.
The issue
It is NOT related to this bundle but exists because of ViolentMonkey latest public version 2.13.0 makes the dev injection fails or if it does not fail, will fail the react code later when using a useEffect or a useState hook.
It is good to notice that you also need to @grant an API method (or several) - (@grant none will not trigger the issue)
After trying to debug it for the last couple of days, I found that this was how they allow the window dom object to be accessed and how react-dom has a specific function that only applies in dev mode. The method is called: invokeGuardedCallbackDev and will try to access the faulty window object to get its event and crash.
The solution for now?
Install one of the latest ViolentMonkey beta. They have seemingly fixed the way they interact with window and unsafeWindow much better now!
It was truly driving me crazy but I am glad this is not a widespread issue, well, at least if somebody is in the same boat as I am, this post will be helpful to others!
Hi,
First off, thank you for creating this boilerplate project which truly helped me fast-forward on a script idea I had been brewing in my head for a while.
The issue
It is NOT related to this bundle but exists because of ViolentMonkey latest public version 2.13.0 makes the dev injection fails or if it does not fail, will fail the react code later when using a
useEffect
or auseState
hook. It is good to notice that you also need to @grant an API method (or several) - (@grant none will not trigger the issue)After trying to debug it for the last couple of days, I found that this was how they allow the
window
dom object to be accessed and howreact-dom
has a specific function that only applies in dev mode. The method is called:invokeGuardedCallbackDev
and will try to access the faultywindow
object to get its event and crash.The solution for now?
Install one of the latest ViolentMonkey beta. They have seemingly fixed the way they interact with
window
andunsafeWindow
much better now!It was truly driving me crazy but I am glad this is not a widespread issue, well, at least if somebody is in the same boat as I am, this post will be helpful to others!