René's URL Explorer Experiment


Title: Global 'document' polyfill causes crashes when used with some node packages · Issue #1144 · NativeScript/nativescript-angular · GitHub

Open Graph Title: Global 'document' polyfill causes crashes when used with some node packages · Issue #1144 · NativeScript/nativescript-angular

X Title: Global 'document' polyfill causes crashes when used with some node packages · Issue #1144 · NativeScript/nativescript-angular

Description: With 5.0.0, a dependency I was using now causes an exception. Switching back to 4.*.* fixes the issue. In my case I'm using fuzzball, whose default module has a dependency tree with node standard modules that are not available in Natives...

Open Graph Description: With 5.0.0, a dependency I was using now causes an exception. Switching back to 4.*.* fixes the issue. In my case I'm using fuzzball, whose default module has a dependency tree with node standard m...

X Description: With 5.0.0, a dependency I was using now causes an exception. Switching back to 4.*.* fixes the issue. In my case I'm using fuzzball, whose default module has a dependency tree with node standa...

Opengraph URL: https://github.com/NativeScript/nativescript-angular/issues/1144

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Global 'document' polyfill causes crashes when used with some node packages","articleBody":"With `5.0.0`, a dependency I was using now causes an exception. Switching back to `4.*.*` fixes the issue. In my case I'm using fuzzball, whose default module has a dependency tree with node standard modules that are not available in Nativescript. Instead, I'm using the minified umd version which has worked up until `nativescript-angular: 5.0.0` and Angular 5. Here is the stack trace for iOS:\r\n\r\n```\r\n***** Fatal JavaScript exception - application has been terminated. *****\r\nNative stack trace:\r\n1   0x10fce57b4 -[TNSRuntime executeModule:referredBy:]\r\n2   0x10f7dbc71 main\r\n3   0x11377565d start\r\nJavaScript stack trace:\r\n1   @file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:5:14902\r\n2   @file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:5:15068\r\n3   @file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:5:15147\r\n4   s@file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:1:693\r\n5   @file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:1:741\r\n6   @file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:1:1893\r\n7   @file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:1:17113\r\n8   s@file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:1:693\r\n9   e@file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:1:861\r\n10  @file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:1:877\r\n11  @file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:1:159\r\n12  anonymous@file:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:1:392\r\n13  evaluate@[native code]\r\n14  moduleEvaluation@[native code]\r\n15  @[native code]\r\n16  promiseReactionJob@[native code]\r\n17  require@[native code]\r\n18  anonymous@file:///app/app.component.js:4:23\r\n19  evaluate@[native code]\r\n20  moduleEvaluation@[native code]\r\n21  @[native code]\r\n22  promiseReactionJob@[native code]\r\n23  require@[native code]\r\n24  anonymous@file:///app/app.module.js:6:30\r\n25  evaluate@[native code]\r\n26  moduleEvaluation@[native code]\r\n27  @[native code]\r\n28  promiseReactionJob@[native code]\r\n29  require@[native code]\r\n30  anonymous@file:///app/main.js:5:27\r\n31  evaluate@[native code]\r\n32  moduleEvaluation@[native code]\r\n33  @[native code]\r\n34  promiseReactionJob@[native code]\r\nJavaScript error:\r\nfile:///app/tns_modules/fuzzball/dist/fuzzball.umd.min.js:5:14902: JS ERROR TypeError: doc.createElement is not a function. (In 'doc.createElement(\"script\")', 'doc.createElement' is undefined)\r\n```\r\n\r\nI'm including a sample project whose package.json you can change to the following in order to no longer get this error:\r\n```\r\n{\r\n  \"description\": \"NativeScript Application\",\r\n  \"license\": \"SEE LICENSE IN \u003cyour-license-filename>\",\r\n  \"readme\": \"NativeScript Application\",\r\n  \"repository\": \"\u003cfill-your-repository-here>\",\r\n  \"nativescript\": {\r\n    \"id\": \"org.nativescript.dependencyerror\",\r\n    \"tns-ios\": {\r\n      \"version\": \"3.4.0\"\r\n    }\r\n  },\r\n  \"dependencies\": {\r\n    \"@angular/animations\": \"~4.4.6\",\r\n    \"@angular/common\": \"~4.4.6\",\r\n    \"@angular/compiler\": \"~4.4.6\",\r\n    \"@angular/core\": \"~4.4.6\",\r\n    \"@angular/forms\": \"~4.4.6\",\r\n    \"@angular/http\": \"~4.4.6\",\r\n    \"@angular/platform-browser\": \"~4.4.6\",\r\n    \"@angular/platform-browser-dynamic\": \"~4.4.6\",\r\n    \"@angular/router\": \"~4.4.6\",\r\n    \"allow-publish\": \"^1.0.4\",\r\n    \"fuzzball\": \"^0.13.6\",\r\n    \"nativescript-angular\": \"~4.4.1\",\r\n    \"nativescript-theme-core\": \"~1.0.4\",\r\n    \"reflect-metadata\": \"~0.1.8\",\r\n    \"rxjs\": \"~5.5.2\",\r\n    \"tns-core-modules\": \"~3.4.0\",\r\n    \"zone.js\": \"~0.8.2\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"nativescript-dev-typescript\": \"~0.5.0\",\r\n    \"typescript\": \"~2.4.2\"\r\n  }\r\n}\r\n```\r\n\r\nFinally, here is the unminified version of the block that fails:\r\n```\r\nif ({}.toString.call(global.process) === \"[object process]\") {\r\n    installNextTickImplementation()\r\n} else if (canUsePostMessage()) {\r\n    installPostMessageImplementation()\r\n} else if (global.MessageChannel) {\r\n    installMessageChannelImplementation()\r\n} else if (doc && \"onreadystatechange\" in doc.createElement(\"script\")) {\r\n    installReadyStateChangeImplementation()\r\n} else {\r\n    installSetTimeoutImplementation()\r\n}\r\n```\r\n\r\nEdit:\r\nAttaching project. Also, this error can be fixed by changing the line\r\n```else if (doc && \"onreadystatechange\" in doc.createElement(\"script\"))```\r\nto \r\n```else if (doc && document.createElement && \"onreadystatechange\" in doc.createElement(\"script\"))```\r\n[dependency-error.zip](https://github.com/NativeScript/nativescript-angular/files/1593459/dependency-error.zip)\r\n\r\n","author":{"url":"https://github.com/vcooley","@type":"Person","name":"vcooley"},"datePublished":"2017-12-29T15:55:38Z","url":"https://github.com/NativeScript/nativescript-angular/issues/1144"}

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:19bee94b-98ba-7679-6f2a-d221e142f244
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8F2E:A71F9:13F3ED5:191F3A5:6B016187
html-safe-nonce2af8b447a7f4f056356259ef608838346062498a709a8dfa2085664084fdeb8f
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RjJFOkE3MUY5OjEzRjNFRDU6MTkxRjNBNTo2QjAxNjE4NyIsInZpc2l0b3JfaWQiOiI0MjI3MjMzMTAzNzM2ODI0MTk5IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac8fba11decbd0daad7ad41ef67fb7a672c7b7a0f3550d4feb5cc28e8a67f0957e
hovercard-subject-tagissue:285114866
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/NativeScript/nativescript-angular/1144/issue_layout
twitter:imagehttps://opengraph.githubassets.com/6e715569288ca69ac8b68f54b75df3390f6663a112c3d7d907b004bee2dbb547/NativeScript/nativescript-angular/issues/1144
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/6e715569288ca69ac8b68f54b75df3390f6663a112c3d7d907b004bee2dbb547/NativeScript/nativescript-angular/issues/1144
og:image:altWith 5.0.0, a dependency I was using now causes an exception. Switching back to 4.*.* fixes the issue. In my case I'm using fuzzball, whose default module has a dependency tree with node standard m...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamevcooley
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
go-importgithub.com/NativeScript/nativescript-angular git https://github.com/NativeScript/nativescript-angular.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id35951404
octolytics-dimension-repository_nwoNativeScript/nativescript-angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id35951404
octolytics-dimension-repository_network_root_nwoNativeScript/nativescript-angular
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
release8c77c9e8439031ad54c75a250694842892f693e1
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/NativeScript/nativescript-angular/issues/1144#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-angular%2Fissues%2F1144
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%2FNativeScript%2Fnativescript-angular%2Fissues%2F1144
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=NativeScript%2Fnativescript-angular
Reloadhttps://github.com/NativeScript/nativescript-angular/issues/1144
Reloadhttps://github.com/NativeScript/nativescript-angular/issues/1144
Reloadhttps://github.com/NativeScript/nativescript-angular/issues/1144
NativeScripthttps://github.com/NativeScript
nativescript-angularhttps://github.com/NativeScript/nativescript-angular
Codehttps://github.com/NativeScript/nativescript-angular
Issues291 (291)https://github.com/NativeScript/nativescript-angular/issues
Pull requests2 (2)https://github.com/NativeScript/nativescript-angular/pulls
Actionshttps://github.com/NativeScript/nativescript-angular/actions
Security and qualityhttps://github.com/NativeScript/nativescript-angular/security
Insightshttps://github.com/NativeScript/nativescript-angular/insights
https://github.com/NativeScript/nativescript-angular
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/nativescript-angular/issues/1144
New issuehttps://github.com/login?return_to=https://github.com/NativeScript/nativescript-angular/issues/1144
#1410https://github.com/NativeScript/nativescript-angular/pull/1410
Global 'document' polyfill causes crashes when used with some node packageshttps://github.com/NativeScript/nativescript-angular/issues/1144#top
#1410https://github.com/NativeScript/nativescript-angular/pull/1410
https://github.com/sis0k0
backloghttps://github.com/NativeScript/nativescript-angular/issues?q=state%3Aopen%20label%3A%22backlog%22
6.1https://github.com/NativeScript/nativescript-angular/milestone/20
https://github.com/vcooley
vcooleyhttps://github.com/vcooley
on Dec 29, 2017https://github.com/NativeScript/nativescript-angular/issues/1144#issue-285114866
dependency-error.ziphttps://github.com/NativeScript/nativescript-angular/files/1593459/dependency-error.zip
NickIlievhttps://github.com/NickIliev
questionhttps://github.com/NativeScript/nativescript-angular/issues?q=state%3Aopen%20label%3A%22question%22
on Jan 2, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1405876756
https://github.com/sis0k0
sis0k0https://github.com/sis0k0
on Jan 2, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#issuecomment-354729467
@vcooleyhttps://github.com/vcooley
Codehttps://github.com/NativeScript/nativescript-angular/blob/master/nativescript-angular/platform.ts#L37
codehttps://github.com/angular/angular/blob/bc7a6d7b0074b0c845035b99d05a831d286b60e4/packages/animations/browser/src/render/shared.ts#L195
sis0k0https://github.com/sis0k0
bughttps://github.com/NativeScript/nativescript-angular/issues?q=state%3Aopen%20label%3A%22bug%22
questionhttps://github.com/NativeScript/nativescript-angular/issues?q=state%3Aopen%20label%3A%22question%22
on Jan 2, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1405967746
sis0k0https://github.com/sis0k0
5.x (TBD)https://github.com/NativeScript/nativescript-angular/milestone/15
on Jan 2, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1405968069
https://github.com/NickIliev
NickIlievhttps://github.com/NickIliev
on Jan 2, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#issuecomment-354729877
#1137https://github.com/NativeScript/nativescript-angular/issues/1137
https://github.com/david-quadpro
david-quadprohttps://github.com/david-quadpro
on Jan 10, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#issuecomment-356564066
https://github.com/david-quadpro
david-quadprohttps://github.com/david-quadpro
on Jan 10, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#issuecomment-356576831
#1137https://github.com/NativeScript/nativescript-angular/issues/1137
Unable to create application com.tns.NativeScriptApplication #3290https://github.com/NativeScript/nativescript-cli/issues/3290
herehttps://stackoverflow.com/questions/45784825/frompromise-does-not-exist-on-type-observable/45785513
https://github.com/GeorgeKnap
GeorgeKnaphttps://github.com/GeorgeKnap
on Jan 16, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#issuecomment-357919507
@david-quadprohttps://github.com/david-quadpro
https://github.com/david-quadpro
david-quadprohttps://github.com/david-quadpro
on Jan 16, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#issuecomment-357922557
https://github.com/GeorgeKnap
GeorgeKnaphttps://github.com/GeorgeKnap
on Jan 16, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#issuecomment-357923720
@david-quadprohttps://github.com/david-quadpro
tsonevnhttps://github.com/tsonevn
sis0k0https://github.com/sis0k0
on Feb 6, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1459634176
sis0k0https://github.com/sis0k0
on Feb 8, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1465004818
sis0k0https://github.com/sis0k0
on Feb 8, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1465104477
tsonevnhttps://github.com/tsonevn
backloghttps://github.com/NativeScript/nativescript-angular/issues?q=state%3Aopen%20label%3A%22backlog%22
on Apr 10, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1565560606
https://github.com/tsonevn
tsonevnhttps://github.com/tsonevn
on Apr 10, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#issuecomment-380018662
#22093https://github.com/angular/angular/issues/22093
vakrilovhttps://github.com/vakrilov
5.x (TBD)https://github.com/NativeScript/nativescript-angular/milestone/15
6.1 (TBD)https://github.com/NativeScript/nativescript-angular/milestone/20
on May 30, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1652913000
sis0k0https://github.com/sis0k0
on Jul 2, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1710966932
fix: remove global document objecthttps://github.com/NativeScript/nativescript-angular/commit/ebcc6a89e5f9c5325883117db2282c4af787c29e
ebcc6a8https://github.com/NativeScript/nativescript-angular/commit/ebcc6a89e5f9c5325883117db2282c4af787c29e
fix: remove global document objecthttps://github.com/NativeScript/nativescript-angular/commit/d367ddd8463f63960152aa8e95fe2182205dc5ce
d367dddhttps://github.com/NativeScript/nativescript-angular/commit/d367ddd8463f63960152aa8e95fe2182205dc5ce
sis0k0https://github.com/sis0k0
completedhttps://github.com/NativeScript/nativescript-angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#1410https://github.com/NativeScript/nativescript-angular/pull/1410
on Jul 3, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1713647148
sis0k0https://github.com/sis0k0
on Jul 3, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1713647209
fix: remove global document objecthttps://github.com/NativeScript/nativescript-angular/commit/2b201be941bf8b899cdf1c2586b88bc562a5fdf0
2b201behttps://github.com/NativeScript/nativescript-angular/commit/2b201be941bf8b899cdf1c2586b88bc562a5fdf0
bughttps://github.com/NativeScript/nativescript-angular/issues?q=state%3Aopen%20label%3A%22bug%22
on Jul 3, 2018https://github.com/NativeScript/nativescript-angular/issues/1144#event-1713647234
Sign up for freehttps://github.com/signup?return_to=https://github.com/NativeScript/nativescript-angular/issues/1144
Sign in to commenthttps://github.com/login?return_to=https://github.com/NativeScript/nativescript-angular/issues/1144
sis0k0https://github.com/sis0k0
backloghttps://github.com/NativeScript/nativescript-angular/issues?q=state%3Aopen%20label%3A%22backlog%22
6.1https://github.com/NativeScript/nativescript-angular/milestone/20
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

Viewport: width=device-width


URLs of crawlers that visited me.