René's URL Explorer Experiment


Title: fix: fix "ERROR in Must have a source file to refactor." error from ngCompilerPlugin on `test` command by Fatme · Pull Request #859 · NativeScript/nativescript-dev-webpack · GitHub

Open Graph Title: fix: fix "ERROR in Must have a source file to refactor." error from ngCompilerPlugin on `test` command by Fatme · Pull Request #859 · NativeScript/nativescript-dev-webpack

X Title: fix: fix "ERROR in Must have a source file to refactor." error from ngCompilerPlugin on `test` command by Fatme · Pull Request #859 · NativeScript/nativescript-dev-webpack

Description: The "ERROR in Must have a source file to refactor." error is thrown when tns test android --path --bundle command is executed. This error is thrown from AngularCompilerPlugin when the path to main.ts file is not correct. We provided the path to main.ts file here. As this path is built using path.resolve and appPath is relative path, the resulting path is still not an absolute path. In this case NodeJS uses current working directory as described here. In other words, in this case resolve(appPath, entryModule) is equal to join(process.cwd(), appPath, entryModule). NativeScript CLI starts 2 webpack processes on test command - one from nativescript-dev-webpack plugin and another one from karma-webpack plugin. When the webpack process is started from nativescript-dev-webpack plugin, cwd is explicitly set here. So, the result from resolve(appPath, entryModule) is correct and AngularCompilerPlugin is happy. When the webpack process is started from karma-webpack plugin, cwd is not set anywhere, so the default value is used. It is fine and works as expected when test command is executed from project directory regardless if --path option is provided. It is not fine and the error is thrown in following cases: When test command is executed with --path option from folder different from project directory When test command is executed from CI where cwd is explicitly provided PR Checklist The PR title follows our guidelines: https://github.com/NativeScript/NativeScript/blob/master/CONTRIBUTING.md#commit-messages. There is an issue for the bug/feature this PR is for. To avoid wasting your time, it's best to open a suggestion issue first and wait for approval before working on it. You have signed the CLA. All existing tests are passing: https://github.com/NativeScript/nativescript-dev-webpack/blob/master/CONTRIBUTING.md#testing-locally-by-running-e2e-tests Tests for the changes are included. What is the current behavior? What is the new behavior? Fixes/Implements/Closes #[Issue Number].

Open Graph Description: The "ERROR in Must have a source file to refactor." error is thrown when tns test android --path <projectPath> --bundle command is executed. This error is thrown from AngularCompile...

X Description: The &quot;ERROR in Must have a source file to refactor.&quot; error is thrown when tns test android --path &lt;projectPath&gt; --bundle command is executed. This error is thrown fro...

Opengraph URL: https://github.com/NativeScript/nativescript-dev-webpack/pull/859

X: @github

direct link

Domain: github.com

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/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:442c7e52-406d-3ab2-62a6-b280679e38a3
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id83A6:1CCECA:9902F9:CC7FC6:6B01C2B6
html-safe-nonced7115bb8810137c7f4cb00fa86f7731cccac5ff22e4ed82585128b15a798d67e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0E2OjFDQ0VDQTo5OTAyRjk6Q0M3RkM2OjZCMDFDMkI2IiwidmlzaXRvcl9pZCI6IjI2NDE0NjgxNTM3MDM1NDc1NzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac3217f2fbf0c7624252f5352713f887990aed47b539b1fdd88c453e795a2faeb7
hovercard-subject-tagpull_request:269531203
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
twitter:imagehttps://avatars.githubusercontent.com/u/760518?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/760518?s=400&v=4
og:image:altThe "ERROR in Must have a source file to refactor." error is thrown when tns test android --path <projectPath> --bundle command is executed. This error is thrown from AngularCompile...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonecc5dfdd32f62ebd3223cab3af3aa2b268d3605218237326a48a99d1efd89495c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/NativeScript/nativescript-dev-webpack git https://github.com/NativeScript/nativescript-dev-webpack.git
octolytics-dimension-user_id7392261
octolytics-dimension-user_loginNativeScript
octolytics-dimension-repository_id54984270
octolytics-dimension-repository_nwoNativeScript/nativescript-dev-webpack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id54984270
octolytics-dimension-repository_network_root_nwoNativeScript/nativescript-dev-webpack
turbo-body-classeslogged-out env-production page-responsive
disable-turbotrue
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

Links:

Skip to contenthttps://github.com/NativeScript/nativescript-dev-webpack/pull/859/files#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FNativeScript%2Fnativescript-dev-webpack%2Fpull%2F859%2Ffiles
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-dev-webpack%2Fpull%2F859%2Ffiles
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=NativeScript%2Fnativescript-dev-webpack
Reloadhttps://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
Reloadhttps://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
Reloadhttps://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
NativeScripthttps://github.com/NativeScript
nativescript-dev-webpackhttps://github.com/NativeScript/nativescript-dev-webpack
Codehttps://github.com/NativeScript/nativescript-dev-webpack
Issues82 (82)https://github.com/NativeScript/nativescript-dev-webpack/issues
Pull requests3 (3)https://github.com/NativeScript/nativescript-dev-webpack/pulls
Actionshttps://github.com/NativeScript/nativescript-dev-webpack/actions
Security and qualityhttps://github.com/NativeScript/nativescript-dev-webpack/security
Insightshttps://github.com/NativeScript/nativescript-dev-webpack/insights
Fatmehttps://github.com/Fatme
releasehttps://github.com/NativeScript/nativescript-dev-webpack/tree/release
fatme/fix-ng-compiler-errorhttps://github.com/NativeScript/nativescript-dev-webpack/tree/fatme/fix-ng-compiler-error
Conversation 1 https://github.com/NativeScript/nativescript-dev-webpack/pull/859
Commits 1 https://github.com/NativeScript/nativescript-dev-webpack/pull/859/commits
Checks 0 https://github.com/NativeScript/nativescript-dev-webpack/pull/859/checks
Files changed https://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
Please reload this pagehttps://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
fix: fix "ERROR in Must have a source file to refactor." error from ngCompilerPlugin on test command https://github.com/NativeScript/nativescript-dev-webpack/pull/859/files#top
Show all changes 1 commit https://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
a5dac53 fix: fix "ERROR in Must have a source file to refactor." error from n… Fatme Apr 11, 2019 https://github.com/NativeScript/nativescript-dev-webpack/pull/859/commits/a5dac53a445479cc2121db7d9a5c5f52f61fce2e
Clear filters https://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
Please reload this pagehttps://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
Please reload this pagehttps://github.com/NativeScript/nativescript-dev-webpack/pull/859/files
templates/webpack.angular.jshttps://github.com/NativeScript/nativescript-dev-webpack/pull/859/files#diff-6243e86680a539ec10c0428a8f422606923351651b5d829ee696e2ef3251587f
View file https://github.com/NativeScript/nativescript-dev-webpack/blob/a5dac53a445479cc2121db7d9a5c5f52f61fce2e/templates/webpack.angular.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/NativeScript/nativescript-dev-webpack/pull/859/{{ revealButtonHref }}
https://github.com/NativeScript/nativescript-dev-webpack/pull/859/files#diff-6243e86680a539ec10c0428a8f422606923351651b5d829ee696e2ef3251587f
https://github.com/NativeScript/nativescript-dev-webpack/pull/859/files#diff-6243e86680a539ec10c0428a8f422606923351651b5d829ee696e2ef3251587f
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.