René's URL Explorer Experiment


Title: There are not 'document.scripts' in mini-program environment · Issue #3705 · getsentry/sentry-javascript · GitHub

Open Graph Title: There are not 'document.scripts' in mini-program environment · Issue #3705 · getsentry/sentry-javascript

X Title: There are not 'document.scripts' in mini-program environment · Issue #3705 · getsentry/sentry-javascript

Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javascript/releases Provide a link to the aff...

Open Graph Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...

X Description: Review the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/3705

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"There are not 'document.scripts' in mini-program environment","articleBody":"\u003c!-- Requirements: please go through this checklist before opening a new issue -->\r\n\r\n- [x] Review the documentation: https://docs.sentry.io/\r\n- [x] Search for existing issues: https://github.com/getsentry/sentry-javascript/issues\r\n- [ ] Use the latest release: https://github.com/getsentry/sentry-javascript/releases\r\n- [ ] Provide a link to the affected event from your Sentry account\r\n\r\n## Package + Version\r\n\r\n- [x] `@sentry/browser`\r\n- [x] `@sentry/node`\r\n- [ ] `raven-js`\r\n- [ ] `raven-node` _(raven for node)_\r\n- [x] `@sentry/tracing`\r\n\r\n### Version:\r\n\r\n```\r\n6.4.1\r\n```\r\n\r\n## Description\r\n\r\nUse '@sentry/tracing' in mini-program environment, when call `Sentry.startTransaction` on a page launch at the first time, whould catch the error as below: \r\n\r\n```\r\nTypeError: Cannot read property 'length' of undefined\r\n    at MetricsInstrumentation.define.push../node_modules/@sentry/tracing/esm/browser/metrics.js.MetricsInstrumentation.addPerformanceEntries (common.js?t=wechat&s=1623694839553&v=ba7f9072bea7d2c8b9666326b3c638e8:6416)\r\n    at common.js?t=wechat&s=1623694839553&v=ba7f9072bea7d2c8b9666326b3c638e8:6315\r\n    at IdleTransaction.define.push../node_modules/@sentry/tracing/esm/idletransaction.js.IdleTransaction.finish (common.js?t=wechat&s=1623694839553&v=ba7f9072bea7d2c8b9666326b3c638e8:7949)\r\n    at Function.\u003canonymous> (common.js?t=wechat&s=1623694839553&v=ba7f9072bea7d2c8b9666326b3c638e8:7932)\r\n    at :12319/appservice/\u003csetTimeout callback function>\r\n    at VM214 WAService.js:2\r\n    at VM214 WAService.js:2(env: macOS,mp,1.05.2105170; lib: 2.17.0)\r\n```\r\n\r\nCheck this error in file `/node_modules/@sentry/tracing/esm/browser/metrics.js`: \r\n\r\n```javascript\r\n        // line 34\r\n        if (global.document) {\r\n            // eslint-disable-next-line @typescript-eslint/prefer-for-of\r\n            for (var i = 0; i \u003c document.scripts.length; i++) { // => There are not document.scripts in mini-program\r\n                // We go through all scripts on the page and look for 'data-entry'\r\n                // We remember the name and measure the time between this script finished loading and\r\n                // our mark 'sentry-tracing-init'\r\n                if (document.scripts[i].dataset.entry === 'true') {\r\n                    entryScriptSrc = document.scripts[i].src;\r\n                    break;\r\n                }\r\n            }\r\n        }\r\n```\r\n\r\nI think should change `if (global.document)` to `if (global.document && document.scripts != null)` will fix this issue.\r\n\r\n","author":{"url":"https://github.com/janpoem","@type":"Person","name":"janpoem"},"datePublished":"2021-06-18T09:34:17Z","url":"https://github.com/getsentry/sentry-javascript/issues/3705"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:1b53a5a5-8a22-ff91-ba8d-3b6e921564c6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idD10E:30975F:476C76:62409F:6B0451E5
html-safe-noncec133f8794e444150675aad6a4bd15dd287a04d1931eec56810fa5c71f5c15615
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMTBFOjMwOTc1Rjo0NzZDNzY6NjI0MDlGOjZCMDQ1MUU1IiwidmlzaXRvcl9pZCI6IjI5MTcxODA4NDY2NTAzNzI4NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacf0e814133c3bc3c8ec5f70575144d2172d342101605bb81307879c55c181c5e0
hovercard-subject-tagissue:924725711
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/3705/issue_layout
twitter:imagehttps://opengraph.githubassets.com/14ba509dc148a784880ba4d089cad412b58b7122e86980726f4fe157b689fefc/getsentry/sentry-javascript/issues/3705
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/14ba509dc148a784880ba4d089cad412b58b7122e86980726f4fe157b689fefc/getsentry/sentry-javascript/issues/3705
og:image:altReview the documentation: https://docs.sentry.io/ Search for existing issues: https://github.com/getsentry/sentry-javascript/issues Use the latest release: https://github.com/getsentry/sentry-javas...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejanpoem
hostnamegithub.com
expected-hostnamegithub.com
None910ca0e260cfec6aff11407d8dc6a0d3a4cd381a2ec9ada56627b063426892a0
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee086f9b7e88322eb2b41885a6ad425b215737fa5
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/3705#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F3705
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F3705
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/3705
Reloadhttps://github.com/getsentry/sentry-javascript/issues/3705
Reloadhttps://github.com/getsentry/sentry-javascript/issues/3705
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues339 (339)https://github.com/getsentry/sentry-javascript/issues
Pull requests53 (53)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/3705
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/3705
#3766https://github.com/getsentry/sentry-javascript/pull/3766
There are not 'document.scripts' in mini-program environmenthttps://github.com/getsentry/sentry-javascript/issues/3705#top
#3766https://github.com/getsentry/sentry-javascript/pull/3766
https://github.com/janpoem
janpoemhttps://github.com/janpoem
on Jun 18, 2021https://github.com/getsentry/sentry-javascript/issues/3705#issue-924725711
https://docs.sentry.io/https://docs.sentry.io/
https://github.com/getsentry/sentry-javascript/issueshttps://github.com/getsentry/sentry-javascript/issues
https://github.com/getsentry/sentry-javascript/releaseshttps://github.com/getsentry/sentry-javascript/releases
janpoemhttps://github.com/janpoem
Status: Needs Triagehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Needs%20Triage%22
on Jun 18, 2021https://github.com/getsentry/sentry-javascript/issues/3705#event-4908789940
AbhiPrasadhttps://github.com/AbhiPrasad
on Jun 29, 2021https://github.com/getsentry/sentry-javascript/issues/3705#event-4954058643
fix(tracing): Add check for document.scripts in metricshttps://github.com/getsentry/sentry-javascript/commit/65a149092a99094bd5923dc40d2c9bc60a6616f0
https://docs.github.com/articles/closing-issues-via-commit-messages
65a1490https://github.com/getsentry/sentry-javascript/commit/65a149092a99094bd5923dc40d2c9bc60a6616f0
fix(tracing): Add check for document.scripts in metricshttps://github.com/getsentry/sentry-javascript/commit/f89b8691bd3ca9933567acb063a5a45f004ff1eb
https://docs.github.com/articles/closing-issues-via-commit-messages
f89b869https://github.com/getsentry/sentry-javascript/commit/f89b8691bd3ca9933567acb063a5a45f004ff1eb
AbhiPrasadhttps://github.com/AbhiPrasad
Feature: Performancehttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Feature%3A%20Performance%22
Status: In Progresshttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20In%20Progress%22
on Jun 29, 2021https://github.com/getsentry/sentry-javascript/issues/3705#event-4954076128
getsantryhttps://github.com/apps/getsantry
Status: Untriagedhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22Status%3A%20Untriaged%22
on Jun 29, 2021https://github.com/getsentry/sentry-javascript/issues/3705#event-4954076290
AbhiPrasadhttps://github.com/AbhiPrasad
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#3766https://github.com/getsentry/sentry-javascript/pull/3766
on Jun 30, 2021https://github.com/getsentry/sentry-javascript/issues/3705#event-4959032545
AbhiPrasadhttps://github.com/AbhiPrasad
on Jun 30, 2021https://github.com/getsentry/sentry-javascript/issues/3705#event-4959032668
fix(tracing): Add check for document.scripts in metrics (#3766)https://github.com/getsentry/sentry-javascript/commit/5289d4082143d186ec1da91087f47284ca87f6c9
#3766https://github.com/getsentry/sentry-javascript/pull/3766
https://docs.github.com/articles/closing-issues-via-commit-messages
5289d40https://github.com/getsentry/sentry-javascript/commit/5289d4082143d186ec1da91087f47284ca87f6c9
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/3705
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/3705
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.