[{"id":"36965096036","type":"IssueCommentEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":257485422,"name":"vitejs/vite","url":"https://api.github.com/repos/vitejs/vite"},"payload":{"action":"created","issue":{"url":"https://api.github.com/repos/vitejs/vite/issues/16222","repository_url":"https://api.github.com/repos/vitejs/vite","labels_url":"https://api.github.com/repos/vitejs/vite/issues/16222/labels{/name}","comments_url":"https://api.github.com/repos/vitejs/vite/issues/16222/comments","events_url":"https://api.github.com/repos/vitejs/vite/issues/16222/events","html_url":"https://github.com/vitejs/vite/pull/16222","id":2199498200,"node_id":"PR_kwDOD1jqbs5qU9CA","number":16222,"title":"fix: hmr with fsCache after concurrent file changes","user":{"login":"patak-dev","id":583075,"node_id":"MDQ6VXNlcjU4MzA3NQ==","avatar_url":"https://avatars.githubusercontent.com/u/583075?v=4","gravatar_id":"","url":"https://api.github.com/users/patak-dev","html_url":"https://github.com/patak-dev","followers_url":"https://api.github.com/users/patak-dev/followers","following_url":"https://api.github.com/users/patak-dev/following{/other_user}","gists_url":"https://api.github.com/users/patak-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/patak-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patak-dev/subscriptions","organizations_url":"https://api.github.com/users/patak-dev/orgs","repos_url":"https://api.github.com/users/patak-dev/repos","events_url":"https://api.github.com/users/patak-dev/events{/privacy}","received_events_url":"https://api.github.com/users/patak-dev/received_events","type":"User","site_admin":false},"labels":[{"id":2242575454,"node_id":"MDU6TGFiZWwyMjQyNTc1NDU0","url":"https://api.github.com/repos/vitejs/vite/labels/feat:%20hmr","name":"feat: hmr","color":"b9d3f7","default":false,"description":""},{"id":2818079671,"node_id":"MDU6TGFiZWwyODE4MDc5Njcx","url":"https://api.github.com/repos/vitejs/vite/labels/p3-minor-bug","name":"p3-minor-bug","color":"BF4D31","default":false,"description":"An edge case that only affects very specific usage (priority)"},{"id":3039135965,"node_id":"MDU6TGFiZWwzMDM5MTM1OTY1","url":"https://api.github.com/repos/vitejs/vite/labels/regression","name":"regression","color":"2B0472","default":false,"description":"The issue only appears after a new release"},{"id":5250028295,"node_id":"LA_kwDOD1jqbs8AAAABOO0TBw","url":"https://api.github.com/repos/vitejs/vite/labels/performance","name":"performance","color":"24D9D7","default":false,"description":"Performance related enhancement"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2024-03-21T08:20:38Z","updated_at":"2024-03-28T12:06:02Z","closed_at":null,"author_association":"MEMBER","active_lock_reason":null,"draft":false,"pull_request":{"url":"https://api.github.com/repos/vitejs/vite/pulls/16222","html_url":"https://github.com/vitejs/vite/pull/16222","diff_url":"https://github.com/vitejs/vite/pull/16222.diff","patch_url":"https://github.com/vitejs/vite/pull/16222.patch","merged_at":null},"body":"### Description\r\n\r\nIt seems we have a race condition for the fs cached checks when automated refactoring tools are used, or the user changes branches with the dev server open. Issue first reported by @cpojer [here](https://discord.com/channels/804011606160703521/1206401295573848074/1209769024003506196)\r\n\r\nScenario (with the dev server open):\r\n- A user renames a file (add, unlink events).\r\n- It then modifies the import (change event).\r\n- HMR works properly, the change is processed after add, unlink so the fs cache is already updated.\r\n- git commit\r\n- git checkout previous commit (change, add, unlink events triggered concurrently)\r\n- HMR could break if we process the change event before the rename (add, unlink)\r\n\r\nThe same could happen with an automated refactoring, depending on the order they do changes.\r\n\r\nI don't know how we can support this except by adding debouncing the processing of watch events so we can ensure that the fs cache has time to be updated before we start the HMR processing. This PR adds a 50ms debounce if the fs cache is active.\r\n\r\nIf this is the only solution to this problem, the tradeoffs of having the fs cache by default changes a bit. We are now trading faster startup and processing for slower HMR. If the needed debounce delay is ~25ms maybe it is acceptable? If we need 50-100ms, then I think we may need to get back to the fs cache being opt-in.\r\n","reactions":{"url":"https://api.github.com/repos/vitejs/vite/issues/16222/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/vitejs/vite/issues/16222/timeline","performed_via_github_app":null,"state_reason":null},"comment":{"url":"https://api.github.com/repos/vitejs/vite/issues/comments/2025025636","html_url":"https://github.com/vitejs/vite/pull/16222#issuecomment-2025025636","issue_url":"https://api.github.com/repos/vitejs/vite/issues/16222","id":2025025636,"node_id":"IC_kwDOD1jqbs54s3Bk","user":{"login":"cpojer","id":13352,"node_id":"MDQ6VXNlcjEzMzUy","avatar_url":"https://avatars.githubusercontent.com/u/13352?v=4","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"created_at":"2024-03-28T12:06:01Z","updated_at":"2024-03-28T12:06:01Z","author_association":"CONTRIBUTOR","body":"I see. Unfortunately I'm traveling for the next two weeks. You could start with 5ms and I can report back after my travels if I'm still running into the same issue.","reactions":{"url":"https://api.github.com/repos/vitejs/vite/issues/comments/2025025636/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}},"public":true,"created_at":"2024-03-28T12:06:03Z","org":{"id":65625612,"login":"vitejs","gravatar_id":"","url":"https://api.github.com/orgs/vitejs","avatar_url":"https://avatars.githubusercontent.com/u/65625612?"}},{"id":"36920977606","type":"IssueCommentEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":257485422,"name":"vitejs/vite","url":"https://api.github.com/repos/vitejs/vite"},"payload":{"action":"created","issue":{"url":"https://api.github.com/repos/vitejs/vite/issues/16222","repository_url":"https://api.github.com/repos/vitejs/vite","labels_url":"https://api.github.com/repos/vitejs/vite/issues/16222/labels{/name}","comments_url":"https://api.github.com/repos/vitejs/vite/issues/16222/comments","events_url":"https://api.github.com/repos/vitejs/vite/issues/16222/events","html_url":"https://github.com/vitejs/vite/pull/16222","id":2199498200,"node_id":"PR_kwDOD1jqbs5qU9CA","number":16222,"title":"fix: hmr with fsCache after concurrent file changes","user":{"login":"patak-dev","id":583075,"node_id":"MDQ6VXNlcjU4MzA3NQ==","avatar_url":"https://avatars.githubusercontent.com/u/583075?v=4","gravatar_id":"","url":"https://api.github.com/users/patak-dev","html_url":"https://github.com/patak-dev","followers_url":"https://api.github.com/users/patak-dev/followers","following_url":"https://api.github.com/users/patak-dev/following{/other_user}","gists_url":"https://api.github.com/users/patak-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/patak-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patak-dev/subscriptions","organizations_url":"https://api.github.com/users/patak-dev/orgs","repos_url":"https://api.github.com/users/patak-dev/repos","events_url":"https://api.github.com/users/patak-dev/events{/privacy}","received_events_url":"https://api.github.com/users/patak-dev/received_events","type":"User","site_admin":false},"labels":[{"id":2242575454,"node_id":"MDU6TGFiZWwyMjQyNTc1NDU0","url":"https://api.github.com/repos/vitejs/vite/labels/feat:%20hmr","name":"feat: hmr","color":"b9d3f7","default":false,"description":""},{"id":2818079671,"node_id":"MDU6TGFiZWwyODE4MDc5Njcx","url":"https://api.github.com/repos/vitejs/vite/labels/p3-minor-bug","name":"p3-minor-bug","color":"BF4D31","default":false,"description":"An edge case that only affects very specific usage (priority)"},{"id":3039135965,"node_id":"MDU6TGFiZWwzMDM5MTM1OTY1","url":"https://api.github.com/repos/vitejs/vite/labels/regression","name":"regression","color":"2B0472","default":false,"description":"The issue only appears after a new release"},{"id":5250028295,"node_id":"LA_kwDOD1jqbs8AAAABOO0TBw","url":"https://api.github.com/repos/vitejs/vite/labels/performance","name":"performance","color":"24D9D7","default":false,"description":"Performance related enhancement"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":9,"created_at":"2024-03-21T08:20:38Z","updated_at":"2024-03-27T08:25:46Z","closed_at":null,"author_association":"MEMBER","active_lock_reason":null,"draft":false,"pull_request":{"url":"https://api.github.com/repos/vitejs/vite/pulls/16222","html_url":"https://github.com/vitejs/vite/pull/16222","diff_url":"https://github.com/vitejs/vite/pull/16222.diff","patch_url":"https://github.com/vitejs/vite/pull/16222.patch","merged_at":null},"body":"### Description\r\n\r\nIt seems we have a race condition for the fs cached checks when automated refactoring tools are used, or the user changes branches with the dev server open. Issue first reported by @cpojer [here](https://discord.com/channels/804011606160703521/1206401295573848074/1209769024003506196)\r\n\r\nScenario (with the dev server open):\r\n- A user renames a file (add, unlink events).\r\n- It then modifies the import (change event).\r\n- HMR works properly, the change is processed after add, unlink so the fs cache is already updated.\r\n- git commit\r\n- git checkout previous commit (change, add, unlink events triggered concurrently)\r\n- HMR could break if we process the change event before the rename (add, unlink)\r\n\r\nThe same could happen with an automated refactoring, depending on the order they do changes.\r\n\r\nI don't know how we can support this except by adding debouncing the processing of watch events so we can ensure that the fs cache has time to be updated before we start the HMR processing. This PR adds a 50ms debounce if the fs cache is active.\r\n\r\nIf this is the only solution to this problem, the tradeoffs of having the fs cache by default changes a bit. We are now trading faster startup and processing for slower HMR. If the needed debounce delay is ~25ms maybe it is acceptable? If we need 50-100ms, then I think we may need to get back to the fs cache being opt-in.\r\n","reactions":{"url":"https://api.github.com/repos/vitejs/vite/issues/16222/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/vitejs/vite/issues/16222/timeline","performed_via_github_app":null,"state_reason":null},"comment":{"url":"https://api.github.com/repos/vitejs/vite/issues/comments/2022193306","html_url":"https://github.com/vitejs/vite/pull/16222#issuecomment-2022193306","issue_url":"https://api.github.com/repos/vitejs/vite/issues/16222","id":2022193306,"node_id":"IC_kwDOD1jqbs54iDia","user":{"login":"cpojer","id":13352,"node_id":"MDQ6VXNlcjEzMzUy","avatar_url":"https://avatars.githubusercontent.com/u/13352?v=4","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"created_at":"2024-03-27T08:25:46Z","updated_at":"2024-03-27T08:25:46Z","author_association":"CONTRIBUTOR","body":"I see what you mean. Let's start with a 15ms delay and see how it goes for everyone?","reactions":{"url":"https://api.github.com/repos/vitejs/vite/issues/comments/2022193306/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}},"public":true,"created_at":"2024-03-27T08:25:47Z","org":{"id":65625612,"login":"vitejs","gravatar_id":"","url":"https://api.github.com/orgs/vitejs","avatar_url":"https://avatars.githubusercontent.com/u/65625612?"}},{"id":"36861230233","type":"IssueCommentEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":257485422,"name":"vitejs/vite","url":"https://api.github.com/repos/vitejs/vite"},"payload":{"action":"created","issue":{"url":"https://api.github.com/repos/vitejs/vite/issues/16222","repository_url":"https://api.github.com/repos/vitejs/vite","labels_url":"https://api.github.com/repos/vitejs/vite/issues/16222/labels{/name}","comments_url":"https://api.github.com/repos/vitejs/vite/issues/16222/comments","events_url":"https://api.github.com/repos/vitejs/vite/issues/16222/events","html_url":"https://github.com/vitejs/vite/pull/16222","id":2199498200,"node_id":"PR_kwDOD1jqbs5qU9CA","number":16222,"title":"fix: hmr with fsCache after concurrent file changes","user":{"login":"patak-dev","id":583075,"node_id":"MDQ6VXNlcjU4MzA3NQ==","avatar_url":"https://avatars.githubusercontent.com/u/583075?v=4","gravatar_id":"","url":"https://api.github.com/users/patak-dev","html_url":"https://github.com/patak-dev","followers_url":"https://api.github.com/users/patak-dev/followers","following_url":"https://api.github.com/users/patak-dev/following{/other_user}","gists_url":"https://api.github.com/users/patak-dev/gists{/gist_id}","starred_url":"https://api.github.com/users/patak-dev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/patak-dev/subscriptions","organizations_url":"https://api.github.com/users/patak-dev/orgs","repos_url":"https://api.github.com/users/patak-dev/repos","events_url":"https://api.github.com/users/patak-dev/events{/privacy}","received_events_url":"https://api.github.com/users/patak-dev/received_events","type":"User","site_admin":false},"labels":[{"id":2242575454,"node_id":"MDU6TGFiZWwyMjQyNTc1NDU0","url":"https://api.github.com/repos/vitejs/vite/labels/feat:%20hmr","name":"feat: hmr","color":"b9d3f7","default":false,"description":""},{"id":2818079671,"node_id":"MDU6TGFiZWwyODE4MDc5Njcx","url":"https://api.github.com/repos/vitejs/vite/labels/p3-minor-bug","name":"p3-minor-bug","color":"BF4D31","default":false,"description":"An edge case that only affects very specific usage (priority)"},{"id":3039135965,"node_id":"MDU6TGFiZWwzMDM5MTM1OTY1","url":"https://api.github.com/repos/vitejs/vite/labels/regression","name":"regression","color":"2B0472","default":false,"description":"The issue only appears after a new release"},{"id":5250028295,"node_id":"LA_kwDOD1jqbs8AAAABOO0TBw","url":"https://api.github.com/repos/vitejs/vite/labels/performance","name":"performance","color":"24D9D7","default":false,"description":"Performance related enhancement"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2024-03-21T08:20:38Z","updated_at":"2024-03-25T16:23:44Z","closed_at":null,"author_association":"MEMBER","active_lock_reason":null,"draft":false,"pull_request":{"url":"https://api.github.com/repos/vitejs/vite/pulls/16222","html_url":"https://github.com/vitejs/vite/pull/16222","diff_url":"https://github.com/vitejs/vite/pull/16222.diff","patch_url":"https://github.com/vitejs/vite/pull/16222.patch","merged_at":null},"body":"### Description\r\n\r\nIt seems we have a race condition for the fs cached checks when automated refactoring tools are used, or the user changes branches with the dev server open. Issue first reported by @cpojer [here](https://discord.com/channels/804011606160703521/1206401295573848074/1209769024003506196)\r\n\r\nScenario (with the dev server open):\r\n- A user renames a file (add, unlink events).\r\n- It then modifies the import (change event).\r\n- HMR works properly, the change is processed after add, unlink so the fs cache is already updated.\r\n- git commit\r\n- git checkout previous commit (change, add, unlink events triggered concurrently)\r\n- HMR could break if we process the change event before the rename (add, unlink)\r\n\r\nThe same could happen with an automated refactoring, depending on the order they do changes.\r\n\r\nI don't know how we can support this except by adding debouncing the processing of watch events so we can ensure that the fs cache has time to be updated before we start the HMR processing. This PR adds a 50ms debounce if the fs cache is active.\r\n\r\nIf this is the only solution to this problem, the tradeoffs of having the fs cache by default changes a bit. We are now trading faster startup and processing for slower HMR. If the needed debounce delay is ~25ms maybe it is acceptable? If we need 50-100ms, then I think we may need to get back to the fs cache being opt-in.\r\n","reactions":{"url":"https://api.github.com/repos/vitejs/vite/issues/16222/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/vitejs/vite/issues/16222/timeline","performed_via_github_app":null,"state_reason":null},"comment":{"url":"https://api.github.com/repos/vitejs/vite/issues/comments/2018399121","html_url":"https://github.com/vitejs/vite/pull/16222#issuecomment-2018399121","issue_url":"https://api.github.com/repos/vitejs/vite/issues/16222","id":2018399121,"node_id":"IC_kwDOD1jqbs54TlOR","user":{"login":"cpojer","id":13352,"node_id":"MDQ6VXNlcjEzMzUy","avatar_url":"https://avatars.githubusercontent.com/u/13352?v=4","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"created_at":"2024-03-25T16:23:44Z","updated_at":"2024-03-25T16:23:44Z","author_association":"CONTRIBUTOR","body":"Ah, apologies, I didn't realize you were waiting for my input on this issue. Any delay that you are choosing here will inevitably lead to race conditions that only some users will run into some of the time. Why can HMR not wait for the filesystem changes directly?","reactions":{"url":"https://api.github.com/repos/vitejs/vite/issues/comments/2018399121/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}},"public":true,"created_at":"2024-03-25T16:23:45Z","org":{"id":65625612,"login":"vitejs","gravatar_id":"","url":"https://api.github.com/orgs/vitejs","avatar_url":"https://avatars.githubusercontent.com/u/65625612?"}},{"id":"36788102535","type":"IssueCommentEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":643836545,"name":"nkzw-tech/remdx","url":"https://api.github.com/repos/nkzw-tech/remdx"},"payload":{"action":"created","issue":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20","repository_url":"https://api.github.com/repos/nkzw-tech/remdx","labels_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/comments","events_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/events","html_url":"https://github.com/nkzw-tech/remdx/issues/20","id":2197195676,"node_id":"I_kwDOJmAqgc6C9ouc","number":20,"title":"@nkzw/remdx@0.12.0: Very old mdx dependency with vuln from transitive dep trim-newlines","user":{"login":"karlhorky","id":1935696,"node_id":"MDQ6VXNlcjE5MzU2OTY=","avatar_url":"https://avatars.githubusercontent.com/u/1935696?v=4","gravatar_id":"","url":"https://api.github.com/users/karlhorky","html_url":"https://github.com/karlhorky","followers_url":"https://api.github.com/users/karlhorky/followers","following_url":"https://api.github.com/users/karlhorky/following{/other_user}","gists_url":"https://api.github.com/users/karlhorky/gists{/gist_id}","starred_url":"https://api.github.com/users/karlhorky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlhorky/subscriptions","organizations_url":"https://api.github.com/users/karlhorky/orgs","repos_url":"https://api.github.com/users/karlhorky/repos","events_url":"https://api.github.com/users/karlhorky/events{/privacy}","received_events_url":"https://api.github.com/users/karlhorky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2024-03-20T10:34:41Z","updated_at":"2024-03-22T07:44:22Z","closed_at":"2024-03-22T07:44:22Z","author_association":"CONTRIBUTOR","active_lock_reason":null,"body":"Hey @cpojer, hope you're well! 👋\r\n\r\nI noticed that the new version `@nkzw/remdx@0.12.0` has a dependency on a very old version of `mdx` ([`\"mdx\": \"^0.3.1\"` in `package.json`](https://unpkg.com/browse/@nkzw/remdx@0.12.0/package.json))\r\n\r\nThis version of `mdx` has a transitive dependency on `trim-newlines@^1.0.0` (via `meow@3.6.0`), which is reported as a security vulnerability by GitHub ([`GHSA-7p7h-4mm5-852v`](https://github.com/advisories/GHSA-7p7h-4mm5-852v)), Socket Security extension (see screenshot below), and is also assigned a CVE `CVE-2021-33623` (\"Uncontrolled Resource Consumption in trim-newlines\")\r\n\r\n![Screenshot 2024-03-20 at 11 28 54](https://github.com/nkzw-tech/remdx/assets/1935696/047880a8-0afd-418f-af03-0cfa7f68a12d)\r\n\r\n![Screenshot 2024-03-20 at 11 27 43](https://github.com/nkzw-tech/remdx/assets/1935696/479af906-addf-47cd-b85e-907e88be6ad4)\r\n\r\n","reactions":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/timeline","performed_via_github_app":null,"state_reason":"completed"},"comment":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/comments/2014520665","html_url":"https://github.com/nkzw-tech/remdx/issues/20#issuecomment-2014520665","issue_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20","id":2014520665,"node_id":"IC_kwDOJmAqgc54EyVZ","user":{"login":"cpojer","id":13352,"node_id":"MDQ6VXNlcjEzMzUy","avatar_url":"https://avatars.githubusercontent.com/u/13352?v=4","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"created_at":"2024-03-22T07:44:22Z","updated_at":"2024-03-22T07:44:22Z","author_association":"COLLABORATOR","body":"Fixed in 0.13.0, but unfortunately I had to add `@mdx-js/react` as a dependency now 🫠","reactions":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/comments/2014520665/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}},"public":true,"created_at":"2024-03-22T07:44:23Z","org":{"id":144984170,"login":"nkzw-tech","gravatar_id":"","url":"https://api.github.com/orgs/nkzw-tech","avatar_url":"https://avatars.githubusercontent.com/u/144984170?"}},{"id":"36788102478","type":"IssuesEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":643836545,"name":"nkzw-tech/remdx","url":"https://api.github.com/repos/nkzw-tech/remdx"},"payload":{"action":"closed","issue":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20","repository_url":"https://api.github.com/repos/nkzw-tech/remdx","labels_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/comments","events_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/events","html_url":"https://github.com/nkzw-tech/remdx/issues/20","id":2197195676,"node_id":"I_kwDOJmAqgc6C9ouc","number":20,"title":"@nkzw/remdx@0.12.0: Very old mdx dependency with vuln from transitive dep trim-newlines","user":{"login":"karlhorky","id":1935696,"node_id":"MDQ6VXNlcjE5MzU2OTY=","avatar_url":"https://avatars.githubusercontent.com/u/1935696?v=4","gravatar_id":"","url":"https://api.github.com/users/karlhorky","html_url":"https://github.com/karlhorky","followers_url":"https://api.github.com/users/karlhorky/followers","following_url":"https://api.github.com/users/karlhorky/following{/other_user}","gists_url":"https://api.github.com/users/karlhorky/gists{/gist_id}","starred_url":"https://api.github.com/users/karlhorky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlhorky/subscriptions","organizations_url":"https://api.github.com/users/karlhorky/orgs","repos_url":"https://api.github.com/users/karlhorky/repos","events_url":"https://api.github.com/users/karlhorky/events{/privacy}","received_events_url":"https://api.github.com/users/karlhorky/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2024-03-20T10:34:41Z","updated_at":"2024-03-22T07:44:22Z","closed_at":"2024-03-22T07:44:22Z","author_association":"CONTRIBUTOR","active_lock_reason":null,"body":"Hey @cpojer, hope you're well! 👋\r\n\r\nI noticed that the new version `@nkzw/remdx@0.12.0` has a dependency on a very old version of `mdx` ([`\"mdx\": \"^0.3.1\"` in `package.json`](https://unpkg.com/browse/@nkzw/remdx@0.12.0/package.json))\r\n\r\nThis version of `mdx` has a transitive dependency on `trim-newlines@^1.0.0` (via `meow@3.6.0`), which is reported as a security vulnerability by GitHub ([`GHSA-7p7h-4mm5-852v`](https://github.com/advisories/GHSA-7p7h-4mm5-852v)), Socket Security extension (see screenshot below), and is also assigned a CVE `CVE-2021-33623` (\"Uncontrolled Resource Consumption in trim-newlines\")\r\n\r\n![Screenshot 2024-03-20 at 11 28 54](https://github.com/nkzw-tech/remdx/assets/1935696/047880a8-0afd-418f-af03-0cfa7f68a12d)\r\n\r\n![Screenshot 2024-03-20 at 11 27 43](https://github.com/nkzw-tech/remdx/assets/1935696/479af906-addf-47cd-b85e-907e88be6ad4)\r\n\r\n","reactions":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/timeline","performed_via_github_app":null,"state_reason":"completed"}},"public":true,"created_at":"2024-03-22T07:44:23Z","org":{"id":144984170,"login":"nkzw-tech","gravatar_id":"","url":"https://api.github.com/orgs/nkzw-tech","avatar_url":"https://avatars.githubusercontent.com/u/144984170?"}},{"id":"36788080296","type":"CreateEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":643836545,"name":"nkzw-tech/remdx","url":"https://api.github.com/repos/nkzw-tech/remdx"},"payload":{"ref":"v0.13.0","ref_type":"tag","master_branch":"main","description":"Beautiful Minimalist React & MDX Presentations","pusher_type":"user"},"public":true,"created_at":"2024-03-22T07:43:24Z","org":{"id":144984170,"login":"nkzw-tech","gravatar_id":"","url":"https://api.github.com/orgs/nkzw-tech","avatar_url":"https://avatars.githubusercontent.com/u/144984170?"}},{"id":"36788079499","type":"PushEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":643836545,"name":"nkzw-tech/remdx","url":"https://api.github.com/repos/nkzw-tech/remdx"},"payload":{"repository_id":643836545,"push_id":17657954110,"size":1,"distinct_size":1,"ref":"refs/heads/main","head":"28720c4c3a373084bcead57bfcad1e560ba79850","before":"2f9c88aa731fe54b4d4d76f0433bf0f3307aa9fb","commits":[{"sha":"28720c4c3a373084bcead57bfcad1e560ba79850","author":{"email":"christoph.pojer@gmail.com","name":"cpojer"},"message":"Fix type export for `MDXComponents`, 0.13.0.","distinct":true,"url":"https://api.github.com/repos/nkzw-tech/remdx/commits/28720c4c3a373084bcead57bfcad1e560ba79850"}]},"public":true,"created_at":"2024-03-22T07:43:22Z","org":{"id":144984170,"login":"nkzw-tech","gravatar_id":"","url":"https://api.github.com/orgs/nkzw-tech","avatar_url":"https://avatars.githubusercontent.com/u/144984170?"}},{"id":"36787965231","type":"CreateEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":643836545,"name":"nkzw-tech/remdx","url":"https://api.github.com/repos/nkzw-tech/remdx"},"payload":{"ref":"v0.12.1","ref_type":"tag","master_branch":"main","description":"Beautiful Minimalist React & MDX Presentations","pusher_type":"user"},"public":true,"created_at":"2024-03-22T07:38:13Z","org":{"id":144984170,"login":"nkzw-tech","gravatar_id":"","url":"https://api.github.com/orgs/nkzw-tech","avatar_url":"https://avatars.githubusercontent.com/u/144984170?"}},{"id":"36787964624","type":"PushEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":643836545,"name":"nkzw-tech/remdx","url":"https://api.github.com/repos/nkzw-tech/remdx"},"payload":{"repository_id":643836545,"push_id":17657899419,"size":1,"distinct_size":1,"ref":"refs/heads/main","head":"2f9c88aa731fe54b4d4d76f0433bf0f3307aa9fb","before":"669251ddceff8307fb8815bd4ba3033a6873591d","commits":[{"sha":"2f9c88aa731fe54b4d4d76f0433bf0f3307aa9fb","author":{"email":"christoph.pojer@gmail.com","name":"cpojer"},"message":"Fix type import again, update deps.","distinct":true,"url":"https://api.github.com/repos/nkzw-tech/remdx/commits/2f9c88aa731fe54b4d4d76f0433bf0f3307aa9fb"}]},"public":true,"created_at":"2024-03-22T07:38:11Z","org":{"id":144984170,"login":"nkzw-tech","gravatar_id":"","url":"https://api.github.com/orgs/nkzw-tech","avatar_url":"https://avatars.githubusercontent.com/u/144984170?"}},{"id":"36787950254","type":"CreateEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":643836545,"name":"nkzw-tech/remdx","url":"https://api.github.com/repos/nkzw-tech/remdx"},"payload":{"ref":"v0.12.0","ref_type":"tag","master_branch":"main","description":"Beautiful Minimalist React & MDX Presentations","pusher_type":"user"},"public":true,"created_at":"2024-03-22T07:37:30Z","org":{"id":144984170,"login":"nkzw-tech","gravatar_id":"","url":"https://api.github.com/orgs/nkzw-tech","avatar_url":"https://avatars.githubusercontent.com/u/144984170?"}},{"id":"36787949627","type":"PushEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":643836545,"name":"nkzw-tech/remdx","url":"https://api.github.com/repos/nkzw-tech/remdx"},"payload":{"repository_id":643836545,"push_id":17657892200,"size":1,"distinct_size":1,"ref":"refs/heads/main","head":"669251ddceff8307fb8815bd4ba3033a6873591d","before":"fa5802d3910c466d7e71df3d72b6d7f0ab3d259f","commits":[{"sha":"669251ddceff8307fb8815bd4ba3033a6873591d","author":{"email":"christoph.pojer@gmail.com","name":"cpojer"},"message":"Add a generated `index.d.ts` file, update deps, v0.12.0.","distinct":true,"url":"https://api.github.com/repos/nkzw-tech/remdx/commits/669251ddceff8307fb8815bd4ba3033a6873591d"}]},"public":true,"created_at":"2024-03-22T07:37:29Z","org":{"id":144984170,"login":"nkzw-tech","gravatar_id":"","url":"https://api.github.com/orgs/nkzw-tech","avatar_url":"https://avatars.githubusercontent.com/u/144984170?"}},{"id":"36787414513","type":"IssueCommentEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":257485422,"name":"vitejs/vite","url":"https://api.github.com/repos/vitejs/vite"},"payload":{"action":"created","issue":{"url":"https://api.github.com/repos/vitejs/vite/issues/16223","repository_url":"https://api.github.com/repos/vitejs/vite","labels_url":"https://api.github.com/repos/vitejs/vite/issues/16223/labels{/name}","comments_url":"https://api.github.com/repos/vitejs/vite/issues/16223/comments","events_url":"https://api.github.com/repos/vitejs/vite/issues/16223/events","html_url":"https://github.com/vitejs/vite/pull/16223","id":2199504776,"node_id":"PR_kwDOD1jqbs5qU-b4","number":16223,"title":"fix: handle warmup request error correctly","user":{"login":"sapphi-red","id":49056869,"node_id":"MDQ6VXNlcjQ5MDU2ODY5","avatar_url":"https://avatars.githubusercontent.com/u/49056869?v=4","gravatar_id":"","url":"https://api.github.com/users/sapphi-red","html_url":"https://github.com/sapphi-red","followers_url":"https://api.github.com/users/sapphi-red/followers","following_url":"https://api.github.com/users/sapphi-red/following{/other_user}","gists_url":"https://api.github.com/users/sapphi-red/gists{/gist_id}","starred_url":"https://api.github.com/users/sapphi-red/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sapphi-red/subscriptions","organizations_url":"https://api.github.com/users/sapphi-red/orgs","repos_url":"https://api.github.com/users/sapphi-red/repos","events_url":"https://api.github.com/users/sapphi-red/events{/privacy}","received_events_url":"https://api.github.com/users/sapphi-red/received_events","type":"User","site_admin":false},"labels":[{"id":2818079671,"node_id":"MDU6TGFiZWwyODE4MDc5Njcx","url":"https://api.github.com/repos/vitejs/vite/labels/p3-minor-bug","name":"p3-minor-bug","color":"BF4D31","default":false,"description":"An edge case that only affects very specific usage (priority)"},{"id":6538299300,"node_id":"LA_kwDOD1jqbs8AAAABhbaHpA","url":"https://api.github.com/repos/vitejs/vite/labels/feat:%20dev","name":"feat: dev","color":"6AC328","default":false,"description":"dev server"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2024-03-21T08:24:42Z","updated_at":"2024-03-22T07:12:46Z","closed_at":"2024-03-21T08:48:58Z","author_association":"MEMBER","active_lock_reason":null,"draft":false,"pull_request":{"url":"https://api.github.com/repos/vitejs/vite/pulls/16223","html_url":"https://github.com/vitejs/vite/pull/16223","diff_url":"https://github.com/vitejs/vite/pull/16223.diff","patch_url":"https://github.com/vitejs/vite/pull/16223.patch","merged_at":"2024-03-21T08:48:58Z"},"body":"\r\n\r\n### Description\r\nAlternative to #16216\r\n\r\nFrom the stack trace, I guess this would catch the error correctly.\r\n\r\nThe reason why `.catch(e => ` cannot catch the error is because `transformRequest` throws an error in sync instead of async.\r\nhttps://github.com/vitejs/vite/blob/d44342859a45a295b9497775f8716de83ca1c03d/packages/vite/src/node/server/transformRequest.ts#L58\r\nSync errors can only be catched by `try {} catch {}`.\r\n\r\nThe fix for it would be to change `transformRequest` to an async function (that would change the sync error into async error), or, to use `try { await transformRequest() } catch {}`. Using both `.catch` and `try {} catch {}` is also an option.\r\nhttps://stackblitz.com/edit/node-zucmtr?file=index.js\r\n\r\nI went with `try { await transformRequest() } catch {}`.\r\n\r\n### Additional context\r\n\r\n\r\n\r\n---\r\n\r\n### What is the purpose of this pull request? \r\n\r\n- [x] Bug fix\r\n- [ ] New Feature\r\n- [ ] Documentation update\r\n- [ ] Other\r\n\r\n### Before submitting the PR, please make sure you do the following\r\n\r\n- [x] Read the [Contributing Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md), especially the [Pull Request Guidelines](https://github.com/vitejs/vite/blob/main/CONTRIBUTING.md#pull-request-guidelines).\r\n- [x] Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.\r\n- [x] Provide a description in this PR that addresses **what** the PR is solving, or reference the issue that it solves (e.g. `fixes #123`).\r\n- [x] Update the corresponding documentation if needed.\r\n- [ ] Ideally, include relevant tests that fail without this PR but pass with it.\r\n","reactions":{"url":"https://api.github.com/repos/vitejs/vite/issues/16223/reactions","total_count":1,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":1,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/vitejs/vite/issues/16223/timeline","performed_via_github_app":null,"state_reason":null},"comment":{"url":"https://api.github.com/repos/vitejs/vite/issues/comments/2014486003","html_url":"https://github.com/vitejs/vite/pull/16223#issuecomment-2014486003","issue_url":"https://api.github.com/repos/vitejs/vite/issues/16223","id":2014486003,"node_id":"IC_kwDOD1jqbs54Ep3z","user":{"login":"cpojer","id":13352,"node_id":"MDQ6VXNlcjEzMzUy","avatar_url":"https://avatars.githubusercontent.com/u/13352?v=4","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"created_at":"2024-03-22T07:12:46Z","updated_at":"2024-03-22T07:12:46Z","author_association":"CONTRIBUTOR","body":"Thank you 🙇♂️ Looking forward to trying this out.","reactions":{"url":"https://api.github.com/repos/vitejs/vite/issues/comments/2014486003/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}},"public":true,"created_at":"2024-03-22T07:12:47Z","org":{"id":65625612,"login":"vitejs","gravatar_id":"","url":"https://api.github.com/orgs/vitejs","avatar_url":"https://avatars.githubusercontent.com/u/65625612?"}},{"id":"36723735237","type":"IssueCommentEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":643836545,"name":"nkzw-tech/remdx","url":"https://api.github.com/repos/nkzw-tech/remdx"},"payload":{"action":"created","issue":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20","repository_url":"https://api.github.com/repos/nkzw-tech/remdx","labels_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/comments","events_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/events","html_url":"https://github.com/nkzw-tech/remdx/issues/20","id":2197195676,"node_id":"I_kwDOJmAqgc6C9ouc","number":20,"title":"@nkzw/remdx@0.12.0: Very old mdx dependency with vuln from transitive dep trim-newlines","user":{"login":"karlhorky","id":1935696,"node_id":"MDQ6VXNlcjE5MzU2OTY=","avatar_url":"https://avatars.githubusercontent.com/u/1935696?v=4","gravatar_id":"","url":"https://api.github.com/users/karlhorky","html_url":"https://github.com/karlhorky","followers_url":"https://api.github.com/users/karlhorky/followers","following_url":"https://api.github.com/users/karlhorky/following{/other_user}","gists_url":"https://api.github.com/users/karlhorky/gists{/gist_id}","starred_url":"https://api.github.com/users/karlhorky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karlhorky/subscriptions","organizations_url":"https://api.github.com/users/karlhorky/orgs","repos_url":"https://api.github.com/users/karlhorky/repos","events_url":"https://api.github.com/users/karlhorky/events{/privacy}","received_events_url":"https://api.github.com/users/karlhorky/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2024-03-20T10:34:41Z","updated_at":"2024-03-20T14:02:59Z","closed_at":null,"author_association":"CONTRIBUTOR","active_lock_reason":null,"body":"Hey @cpojer, hope you're well! 👋\r\n\r\nI noticed that the new version `@nkzw/remdx@0.12.0` has a dependency on a very old version of `mdx` ([`\"mdx\": \"^0.3.1\"` in `package.json`](https://unpkg.com/browse/@nkzw/remdx@0.12.0/package.json))\r\n\r\nThis version of `mdx` has a transitive dependency on `trim-newlines@^1.0.0` (via `meow@3.6.0`), which is reported as a security vulnerability by GitHub ([`GHSA-7p7h-4mm5-852v`](https://github.com/advisories/GHSA-7p7h-4mm5-852v)), Socket Security extension (see screenshot below), and is also assigned a CVE `CVE-2021-33623` (\"Uncontrolled Resource Consumption in trim-newlines\")\r\n\r\n![Screenshot 2024-03-20 at 11 28 54](https://github.com/nkzw-tech/remdx/assets/1935696/047880a8-0afd-418f-af03-0cfa7f68a12d)\r\n\r\n![Screenshot 2024-03-20 at 11 27 43](https://github.com/nkzw-tech/remdx/assets/1935696/479af906-addf-47cd-b85e-907e88be6ad4)\r\n\r\n","reactions":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20/timeline","performed_via_github_app":null,"state_reason":null},"comment":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/comments/2009650646","html_url":"https://github.com/nkzw-tech/remdx/issues/20#issuecomment-2009650646","issue_url":"https://api.github.com/repos/nkzw-tech/remdx/issues/20","id":2009650646,"node_id":"IC_kwDOJmAqgc53yNXW","user":{"login":"cpojer","id":13352,"node_id":"MDQ6VXNlcjEzMzUy","avatar_url":"https://avatars.githubusercontent.com/u/13352?v=4","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"created_at":"2024-03-20T14:02:58Z","updated_at":"2024-03-20T14:02:58Z","author_association":"COLLABORATOR","body":"Ah, apologies, I was fixing things up as I was preparing for my React Vienna talk. I'll push a fix and the tags once I arrive in Vienna.","reactions":{"url":"https://api.github.com/repos/nkzw-tech/remdx/issues/comments/2009650646/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"performed_via_github_app":null}},"public":true,"created_at":"2024-03-20T14:02:59Z","org":{"id":144984170,"login":"nkzw-tech","gravatar_id":"","url":"https://api.github.com/orgs/nkzw-tech","avatar_url":"https://avatars.githubusercontent.com/u/144984170?"}},{"id":"36615568752","type":"IssuesEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":157846876,"name":"framer/motion","url":"https://api.github.com/repos/framer/motion"},"payload":{"action":"opened","issue":{"url":"https://api.github.com/repos/framer/motion/issues/2564","repository_url":"https://api.github.com/repos/framer/motion","labels_url":"https://api.github.com/repos/framer/motion/issues/2564/labels{/name}","comments_url":"https://api.github.com/repos/framer/motion/issues/2564/comments","events_url":"https://api.github.com/repos/framer/motion/issues/2564/events","html_url":"https://github.com/framer/motion/issues/2564","id":2190437587,"node_id":"I_kwDOCWiNXM6Cj2zT","number":2564,"title":"[BUG] TypeError: Cannot read properties of null (reading 'animate')","user":{"login":"cpojer","id":13352,"node_id":"MDQ6VXNlcjEzMzUy","avatar_url":"https://avatars.githubusercontent.com/u/13352?v=4","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"labels":[{"id":1129800896,"node_id":"MDU6TGFiZWwxMTI5ODAwODk2","url":"https://api.github.com/repos/framer/motion/labels/bug","name":"bug","color":"FF0088","default":true,"description":"Something isn't working"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2024-03-17T01:55:52Z","updated_at":"2024-03-17T01:55:52Z","closed_at":null,"author_association":"NONE","active_lock_reason":null,"body":"Following up on https://github.com/framer/motion/issues/2558, I updated to 11.0.14 and immediately saw production crashes again:\r\n\r\n![CleanShot 2024-03-17 at 10 54 03@2x](https://github.com/framer/motion/assets/13352/bf4cad7d-f2f7-4b42-a226-842e0c34f678)\r\n\r\nI immediately reverted the change and I'm running 11.0.8 again. It appears there is still a regression in the latest patch releases.","reactions":{"url":"https://api.github.com/repos/framer/motion/issues/2564/reactions","total_count":0,"+1":0,"-1":0,"laugh":0,"hooray":0,"confused":0,"heart":0,"rocket":0,"eyes":0},"timeline_url":"https://api.github.com/repos/framer/motion/issues/2564/timeline","performed_via_github_app":null,"state_reason":null}},"public":true,"created_at":"2024-03-17T01:55:54Z","org":{"id":42876,"login":"framer","gravatar_id":"","url":"https://api.github.com/orgs/framer","avatar_url":"https://avatars.githubusercontent.com/u/42876?"}},{"id":"36571133349","type":"IssuesEvent","actor":{"id":13352,"login":"cpojer","display_login":"cpojer","gravatar_id":"","url":"https://api.github.com/users/cpojer","avatar_url":"https://avatars.githubusercontent.com/u/13352?"},"repo":{"id":157846876,"name":"framer/motion","url":"https://api.github.com/repos/framer/motion"},"payload":{"action":"opened","issue":{"url":"https://api.github.com/repos/framer/motion/issues/2558","repository_url":"https://api.github.com/repos/framer/motion","labels_url":"https://api.github.com/repos/framer/motion/issues/2558/labels{/name}","comments_url":"https://api.github.com/repos/framer/motion/issues/2558/comments","events_url":"https://api.github.com/repos/framer/motion/issues/2558/events","html_url":"https://github.com/framer/motion/issues/2558","id":2187575912,"node_id":"I_kwDOCWiNXM6CY8Jo","number":2558,"title":"[BUG] Destructuring issue introduced between framer-motion 11.0.8 and 11.0.13","user":{"login":"cpojer","id":13352,"node_id":"MDQ6VXNlcjEzMzUy","avatar_url":"https://avatars.githubusercontent.com/u/13352?v=4","gravatar_id":"","url":"https://api.github.com/users/cpojer","html_url":"https://github.com/cpojer","followers_url":"https://api.github.com/users/cpojer/followers","following_url":"https://api.github.com/users/cpojer/following{/other_user}","gists_url":"https://api.github.com/users/cpojer/gists{/gist_id}","starred_url":"https://api.github.com/users/cpojer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cpojer/subscriptions","organizations_url":"https://api.github.com/users/cpojer/orgs","repos_url":"https://api.github.com/users/cpojer/repos","events_url":"https://api.github.com/users/cpojer/events{/privacy}","received_events_url":"https://api.github.com/users/cpojer/received_events","type":"User","site_admin":false},"labels":[{"id":1129800896,"node_id":"MDU6TGFiZWwxMTI5ODAwODk2","url":"https://api.github.com/repos/framer/motion/labels/bug","name":"bug","color":"FF0088","default":true,"description":"Something isn't working"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2024-03-15T02:00:39Z","updated_at":"2024-03-15T02:00:39Z","closed_at":null,"author_association":"NONE","active_lock_reason":null,"body":"I updated `framer-motion` in [Athena Crisis](https://athenacrisis.com) today and immediately got tons of production errors about issues with framer-motion. Here are some traces:\r\n\r\n![CleanShot 2024-03-15 at 10 56 33@2x](https://github.com/framer/motion/assets/13352/5a27249d-4d1a-4e46-9004-7fce2ba04e1a)\r\n\r\n![CleanShot 2024-03-15 at 10 56 54@2x](https://github.com/framer/motion/assets/13352/ef69bee1-24c8-43dc-ad33-b15f4c433be3)\r\n\r\nThe errors were thrown vor many users, across platforms. None of my first-party code has changed with this update, so there must be one or two bugs in framer-motion that were introduced between the latest patch releases.\r\n\r\nThe first-party code in the first stack trace above looks like this:\r\n```tsx\r\nimport Icon from '@deities/ui/Icon.tsx';\r\nimport { css, cx } from '@emotion/css';\r\nimport Coin from '@iconify-icons/pixelarticons/coin.js';\r\nimport {\r\n motion,\r\n useMotionValueEvent,\r\n useSpring,\r\n useTransform,\r\n} from 'framer-motion';\r\nimport { useEffect, useState } from 'react';\r\n\r\nconst format = (number: number) => Math.round(number).toLocaleString();\r\n\r\nexport default function Funds({\r\n className,\r\n value,\r\n}: {\r\n className?: string;\r\n value: number | string;\r\n}) {\r\n const [isAnimating, setIsAnimating] = useState(false);\r\n const isString = typeof value === 'string';\r\n const numberValue = isString ? 0 : value;\r\n const motionValue = useSpring(numberValue, {\r\n damping: 20,\r\n mass: 0.5,\r\n stiffness: 100,\r\n });\r\n const displayValue = useTransform(motionValue, format);\r\n\r\n useEffect(() => {\r\n motionValue.set(numberValue);\r\n }, [motionValue, numberValue]);\r\n\r\n useMotionValueEvent(displayValue, 'change', (currentValue) => {\r\n if (!isAnimating) {\r\n setIsAnimating(true);\r\n } else if (currentValue === format(numberValue)) {\r\n setIsAnimating(false);\r\n }\r\n });\r\n\r\n return (\r\n