getsentry / getsentry/sentry-javascript

False positive pushstate warnings with SvelteKit

Đang mở
#13,823 8 bình luận 0 reaction 0 người được giao Xem trên GitHub
Improvement SvelteKit
Ngôn ngữ chính
TypeScript
Star
8.7k
Fork
1.8k
Merge trung bình
1 ngày 17 giờ
Pull request đã merge (30 ngày)
515

Mô tả

### Is there an existing issue for this?

- [x] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- [x] I have reviewed the documentation https://docs.sentry.io/
- [x] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases

### How do you use Sentry?

Sentry Saas (sentry.io)

### Which SDK are you using?

@sentry/sveltekit

### SDK Version

8.32.0

### Framework Version

sveltekit 2.5.28

### Link to Sentry event

_No response_

### Reproduction Example/SDK Setup

https://github.com/sveltejs/kit/issues/12177

### Steps to Reproduce

Just start a sveltekit app with sentry and on first page load you will see the warning.

seems like initiating here `// node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js`

`[Warning] Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead. (client.js, line xxx)`

### Expected Result

No wanning while using svelte app navigation.

### Actual Result

![Image](https://github.com/user-attachments/assets/1fe4c303-3e7b-4619-8caf-dd9b7a92d43b)

`[Warning] Avoid using `history.pushState(...)` and `history.replaceState(...)` as these will conflict with SvelteKit's router. Use the `pushState` and `replaceState` imports from `$app/navigation` instead. (client.js, line xxx)`

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.