@khester/create-dynamics-app 1.0.8 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/create-dynamics-app.js +1 -1
- package/dist/index.js +140 -15
- package/dist/index.js.map +1 -1
- package/dist/utils/consultingHelpers.d.ts +13 -0
- package/dist/utils/consultingHelpers.d.ts.map +1 -0
- package/dist/utils/consultingHelpers.js +569 -0
- package/dist/utils/consultingHelpers.js.map +1 -0
- package/dist/utils/copyTemplate.d.ts.map +1 -1
- package/dist/utils/copyTemplate.js.map +1 -1
- package/dist/utils/initGit.d.ts.map +1 -1
- package/dist/utils/initGit.js.map +1 -1
- package/dist/utils/installDependencies.d.ts.map +1 -1
- package/dist/utils/installDependencies.js +3 -2
- package/dist/utils/installDependencies.js.map +1 -1
- package/dist/utils/updatePackageJson.d.ts +1 -1
- package/dist/utils/updatePackageJson.d.ts.map +1 -1
- package/dist/utils/updatePackageJson.js +11 -1
- package/dist/utils/updatePackageJson.js.map +1 -1
- package/package.json +1 -1
- package/templates/dynamics-365-starter/INTEGRATION_TEST_RESULTS.md +302 -0
- package/templates/dynamics-365-starter/PHASE_4_COMPLETION_SUMMARY.md +305 -0
- package/templates/dynamics-365-starter/README.md +566 -137
- package/templates/dynamics-365-starter/deployment/QUICKSTART-MAC.md +507 -0
- package/templates/dynamics-365-starter/deployment/QUICKSTART-WINDOWS.md +372 -0
- package/templates/dynamics-365-starter/deployment/README.md +484 -0
- package/templates/dynamics-365-starter/deployment/pipelines/README.md +375 -0
- package/templates/dynamics-365-starter/deployment/pipelines/azure-pipelines.yml +330 -0
- package/templates/dynamics-365-starter/deployment/pipelines/github-actions.yml +422 -0
- package/templates/dynamics-365-starter/deployment/pipelines/jenkins.groovy +636 -0
- package/templates/dynamics-365-starter/deployment/scripts/deploy.ps1 +417 -0
- package/templates/dynamics-365-starter/deployment/scripts/deploy.sh +582 -0
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.ps1 +486 -0
- package/templates/dynamics-365-starter/deployment/scripts/team-onboarding.sh +567 -0
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.ps1 +703 -0
- package/templates/dynamics-365-starter/deployment/scripts/validate-setup.sh +671 -0
- package/templates/dynamics-365-starter/docs/ARCHITECTURE_OVERVIEW.md +506 -0
- package/templates/dynamics-365-starter/docs/BEST_PRACTICES.md +723 -0
- package/templates/dynamics-365-starter/docs/MIGRATION_GUIDE.md +447 -0
- package/templates/dynamics-365-starter/docs/team-standards/README.md +273 -0
- package/templates/dynamics-365-starter/docs/team-standards/client-onboarding.md +577 -0
- package/templates/dynamics-365-starter/docs/team-standards/code-review-checklist.md +359 -0
- package/templates/dynamics-365-starter/docs/team-standards/coding-standards.md +700 -0
- package/templates/dynamics-365-starter/docs/team-standards/cross-platform-team-guide.md +736 -0
- package/templates/dynamics-365-starter/docs/team-standards/development-workflows.md +727 -0
- package/templates/dynamics-365-starter/docs/troubleshooting/common-errors.md +758 -0
- package/templates/dynamics-365-starter/docs/troubleshooting/platform-specific-issues.md +878 -0
- package/templates/dynamics-365-starter/package.json +22 -1
- package/templates/dynamics-365-starter/public/index.html +8 -11
- package/templates/dynamics-365-starter/scripts/custom-build.js +255 -0
- package/templates/dynamics-365-starter/src/client-project-template/README.md +234 -0
- package/templates/dynamics-365-starter/src/client-project-template/config/client.template.json +114 -0
- package/templates/dynamics-365-starter/src/client-project-template/config/environments/template.json +186 -0
- package/templates/dynamics-365-starter/src/client-project-template/scripts/client-setup.js +667 -0
- package/templates/dynamics-365-starter/src/components/AccountForm.css +71 -0
- package/templates/dynamics-365-starter/src/components/AccountForm.tsx +541 -0
- package/templates/dynamics-365-starter/src/components/AccountManagement.css +86 -0
- package/templates/dynamics-365-starter/src/components/AccountManagement.tsx +370 -0
- package/templates/dynamics-365-starter/src/components/ContactForm.tsx +149 -63
- package/templates/dynamics-365-starter/src/components/ContactManagement.tsx +153 -63
- package/templates/dynamics-365-starter/src/components/Logging/LogDialog.tsx +291 -0
- package/templates/dynamics-365-starter/src/components/Logging/LoggingContext.tsx +166 -0
- package/templates/dynamics-365-starter/src/components/Logging/LoggingDebugPanel.css +192 -0
- package/templates/dynamics-365-starter/src/components/Logging/LoggingDebugPanel.tsx +177 -0
- package/templates/dynamics-365-starter/src/components/Logging/LoggingProvider.tsx +3 -0
- package/templates/dynamics-365-starter/src/components/Logging/logger.ts +193 -0
- package/templates/dynamics-365-starter/src/constants/account.ts +410 -0
- package/templates/dynamics-365-starter/src/constants/contact.ts +362 -0
- package/templates/dynamics-365-starter/src/examples/README.md +52 -0
- package/templates/dynamics-365-starter/src/examples/component-examples/opportunity-management.tsx +625 -0
- package/templates/dynamics-365-starter/src/examples/entity-examples/opportunity-model.ts +545 -0
- package/templates/dynamics-365-starter/src/examples/integration-examples/custom-pcf-wrapper.tsx +722 -0
- package/templates/dynamics-365-starter/src/examples/workflow-examples/sales-workflow.ts +662 -0
- package/templates/dynamics-365-starter/src/index.tsx +107 -19
- package/templates/dynamics-365-starter/src/models/Account.ts +480 -0
- package/templates/dynamics-365-starter/src/models/BaseEntity.ts +204 -0
- package/templates/dynamics-365-starter/src/models/Contact.ts +580 -0
- package/templates/dynamics-365-starter/src/page-templates/EntityDashboard.tsx +519 -0
- package/templates/dynamics-365-starter/src/page-templates/EntityDetailPage.tsx +456 -0
- package/templates/dynamics-365-starter/src/page-templates/EntityListPage.tsx +406 -0
- package/templates/dynamics-365-starter/src/page-templates/RelatedEntitiesPage.tsx +578 -0
- package/templates/dynamics-365-starter/src/page-templates/SearchPage.tsx +629 -0
- package/templates/dynamics-365-starter/src/pcf/ContactControlWrapper.tsx +75 -22
- package/templates/dynamics-365-starter/src/pcf/MultiEntityControlWrapper.tsx +205 -0
- package/templates/dynamics-365-starter/src/providers/DynamicsProvider.tsx +297 -80
- package/templates/dynamics-365-starter/src/services/MockApiService.ts +260 -0
- package/templates/dynamics-365-starter/src/services/ServiceFactory.ts +65 -0
- package/templates/dynamics-365-starter/src/services/XrmApiService.ts +213 -0
- package/templates/dynamics-365-starter/src/styles/index.css +74 -7
- package/templates/dynamics-365-starter/tools/entity-generator/index.js +168 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/constants.template.ts +124 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.css +283 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/form.template.tsx +275 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.css +204 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/management.template.tsx +413 -0
- package/templates/dynamics-365-starter/tools/entity-generator/templates/model.template.ts +250 -0
- package/templates/dynamics-365-starter/tools/metadata-sync/d365-client.js +410 -0
- package/templates/dynamics-365-starter/tools/metadata-sync/index.js +512 -0
- package/templates/dynamics-365-starter/tools/metadata-sync/type-generator.js +675 -0
- package/templates/dynamics-365-starter/tsconfig.json +11 -8
- package/templates/dynamics-365-starter/webpack.config.js +8 -9
- package/templates/power-pages-starter/README.md +7 -1
- package/templates/power-pages-starter/public/index.html +8 -11
- package/templates/power-pages-starter/src/components/ContactForm.tsx +60 -41
- package/templates/power-pages-starter/src/index.tsx +3 -3
- package/templates/power-pages-starter/src/providers/PowerPagesProvider.tsx +46 -23
- package/templates/power-pages-starter/tsconfig.json +3 -9
- package/templates/power-pages-starter/webpack.config.js +8 -3
|
@@ -0,0 +1,758 @@
|
|
|
1
|
+
# Common Errors and Solutions
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This document catalogs frequently encountered errors in cross-platform Dynamics 365 development and
|
|
6
|
+
provides step-by-step solutions for both Windows and Mac environments.
|
|
7
|
+
|
|
8
|
+
## Table of Contents
|
|
9
|
+
|
|
10
|
+
1. [Build and Compilation Errors](#build-and-compilation-errors)
|
|
11
|
+
2. [Deployment Errors](#deployment-errors)
|
|
12
|
+
3. [Authentication Errors](#authentication-errors)
|
|
13
|
+
4. [Environment Setup Errors](#environment-setup-errors)
|
|
14
|
+
5. [Git and Version Control Errors](#git-and-version-control-errors)
|
|
15
|
+
6. [Package Management Errors](#package-management-errors)
|
|
16
|
+
7. [Runtime Errors](#runtime-errors)
|
|
17
|
+
|
|
18
|
+
## Build and Compilation Errors
|
|
19
|
+
|
|
20
|
+
### Error: TypeScript compilation failed
|
|
21
|
+
|
|
22
|
+
**Symptoms:**
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
error TS2307: Cannot find module './MyComponent' or its type declarations.
|
|
26
|
+
error TS2345: Argument of type 'string' is not assignable to parameter of type 'number'.
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Cause:** TypeScript configuration issues or incorrect import paths
|
|
30
|
+
|
|
31
|
+
**Solution:**
|
|
32
|
+
|
|
33
|
+
**Step 1: Check TypeScript configuration**
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
# Validate tsconfig.json
|
|
37
|
+
npx tsc --showConfig
|
|
38
|
+
|
|
39
|
+
# Check for TypeScript errors
|
|
40
|
+
npm run typecheck
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
**Step 2: Fix common import issues**
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
// ❌ Wrong - case mismatch
|
|
47
|
+
import MyComponent from './mycomponent';
|
|
48
|
+
|
|
49
|
+
// ✅ Correct - exact case match
|
|
50
|
+
import MyComponent from './MyComponent';
|
|
51
|
+
|
|
52
|
+
// ❌ Wrong - missing extension in some configs
|
|
53
|
+
import utils from './utils';
|
|
54
|
+
|
|
55
|
+
// ✅ Correct - explicit extension
|
|
56
|
+
import utils from './utils.ts';
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Step 3: Platform-specific path resolution**
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
// tsconfig.json - ensure cross-platform compatibility
|
|
63
|
+
{
|
|
64
|
+
"compilerOptions": {
|
|
65
|
+
"baseUrl": ".",
|
|
66
|
+
"paths": {
|
|
67
|
+
"@/*": ["src/*"],
|
|
68
|
+
"@components/*": ["src/components/*"]
|
|
69
|
+
},
|
|
70
|
+
"moduleResolution": "node"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Error: Webpack build fails with "Module not found"
|
|
76
|
+
|
|
77
|
+
**Symptoms:**
|
|
78
|
+
|
|
79
|
+
```
|
|
80
|
+
Module not found: Error: Can't resolve './component' in '/project/src'
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
**Cause:** Incorrect file paths or case sensitivity issues
|
|
84
|
+
|
|
85
|
+
**Solution:**
|
|
86
|
+
|
|
87
|
+
**Windows:**
|
|
88
|
+
|
|
89
|
+
```powershell
|
|
90
|
+
# Check file existence (case-insensitive)
|
|
91
|
+
Test-Path "src\components\MyComponent.tsx"
|
|
92
|
+
|
|
93
|
+
# List actual file names
|
|
94
|
+
Get-ChildItem "src\components" | Select-Object Name
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Mac:**
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# Check file existence (case-sensitive)
|
|
101
|
+
ls -la src/components/MyComponent.tsx
|
|
102
|
+
|
|
103
|
+
# Find files with case variations
|
|
104
|
+
find src/components -iname "*mycomponent*"
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
**Cross-platform fix:**
|
|
108
|
+
|
|
109
|
+
```javascript
|
|
110
|
+
// webpack.config.js - Add case-sensitive resolver
|
|
111
|
+
module.exports = {
|
|
112
|
+
resolve: {
|
|
113
|
+
alias: {
|
|
114
|
+
'@': path.resolve(__dirname, 'src'),
|
|
115
|
+
},
|
|
116
|
+
extensions: ['.tsx', '.ts', '.js', '.jsx'],
|
|
117
|
+
// Enforce case sensitivity
|
|
118
|
+
plugins: [new CaseSensitivePathsPlugin()],
|
|
119
|
+
},
|
|
120
|
+
};
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Deployment Errors
|
|
124
|
+
|
|
125
|
+
### Error: PowerShell execution policy prevents script execution
|
|
126
|
+
|
|
127
|
+
**Symptoms:**
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
.\deploy.ps1 : File cannot be loaded because running scripts is disabled on this system.
|
|
131
|
+
At line:1 char:1
|
|
132
|
+
+ .\deploy.ps1
|
|
133
|
+
+ ~~~~~~~~~~~~
|
|
134
|
+
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
|
|
135
|
+
+ FullyQualifiedErrorId : UnauthorizedAccess
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
**Cause:** Windows PowerShell execution policy is set to Restricted
|
|
139
|
+
|
|
140
|
+
**Solution:**
|
|
141
|
+
|
|
142
|
+
**Step 1: Check current policy**
|
|
143
|
+
|
|
144
|
+
```powershell
|
|
145
|
+
Get-ExecutionPolicy -List
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
**Step 2: Set appropriate policy**
|
|
149
|
+
|
|
150
|
+
```powershell
|
|
151
|
+
# For current user (recommended)
|
|
152
|
+
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
|
|
153
|
+
|
|
154
|
+
# For current session only
|
|
155
|
+
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process
|
|
156
|
+
|
|
157
|
+
# Verify change
|
|
158
|
+
Get-ExecutionPolicy
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Step 3: Alternative using bypass**
|
|
162
|
+
|
|
163
|
+
```powershell
|
|
164
|
+
# Run script with bypass
|
|
165
|
+
powershell -ExecutionPolicy Bypass -File .\deploy.ps1 -Environment dev
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
### Error: Bash script permission denied
|
|
169
|
+
|
|
170
|
+
**Symptoms:**
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
bash: ./deploy.sh: Permission denied
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Cause:** Script doesn't have execute permissions
|
|
177
|
+
|
|
178
|
+
**Solution:**
|
|
179
|
+
|
|
180
|
+
**Step 1: Check current permissions**
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
ls -la deployment/scripts/deploy.sh
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
**Step 2: Add execute permission**
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
# Single script
|
|
190
|
+
chmod +x deployment/scripts/deploy.sh
|
|
191
|
+
|
|
192
|
+
# All shell scripts
|
|
193
|
+
chmod +x deployment/scripts/*.sh
|
|
194
|
+
|
|
195
|
+
# Recursive for all scripts
|
|
196
|
+
find deployment -name "*.sh" -exec chmod +x {} \;
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Step 3: Commit permission changes**
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
git update-index --chmod=+x deployment/scripts/deploy.sh
|
|
203
|
+
git commit -m "fix: make deployment scripts executable"
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
### Error: Dynamics 365 connection failed
|
|
207
|
+
|
|
208
|
+
**Symptoms:**
|
|
209
|
+
|
|
210
|
+
```
|
|
211
|
+
Error: Unable to connect to Dynamics 365 environment
|
|
212
|
+
HTTP 401: Unauthorized
|
|
213
|
+
```
|
|
214
|
+
|
|
215
|
+
**Cause:** Authentication credentials or configuration issues
|
|
216
|
+
|
|
217
|
+
**Solution:**
|
|
218
|
+
|
|
219
|
+
**Step 1: Verify environment configuration**
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
# Check configuration file exists
|
|
223
|
+
ls -la config/environments/dev.json
|
|
224
|
+
|
|
225
|
+
# Validate JSON syntax
|
|
226
|
+
jq empty config/environments/dev.json
|
|
227
|
+
```
|
|
228
|
+
|
|
229
|
+
**Step 2: Test authentication**
|
|
230
|
+
|
|
231
|
+
**Windows:**
|
|
232
|
+
|
|
233
|
+
```powershell
|
|
234
|
+
# Test connection script
|
|
235
|
+
.\deployment\scripts\test-connection.ps1 -Environment dev -Verbose
|
|
236
|
+
|
|
237
|
+
# Check environment variables
|
|
238
|
+
Get-ChildItem Env: | Where-Object {$_.Name -like "*D365*"}
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
**Mac:**
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
# Test connection script
|
|
245
|
+
./deployment/scripts/test-connection.sh dev --verbose
|
|
246
|
+
|
|
247
|
+
# Check environment variables
|
|
248
|
+
env | grep D365
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**Step 3: Verify credentials**
|
|
252
|
+
|
|
253
|
+
```javascript
|
|
254
|
+
// Create test script: test-auth.js
|
|
255
|
+
const config = require('./config/environments/dev.json');
|
|
256
|
+
|
|
257
|
+
console.log('Testing configuration:');
|
|
258
|
+
console.log('Org URL:', config.dynamics365.orgUrl);
|
|
259
|
+
console.log('Client ID:', config.authentication.clientId ? 'Set' : 'Missing');
|
|
260
|
+
console.log('Client Secret:', config.authentication.clientSecret ? 'Set' : 'Missing');
|
|
261
|
+
|
|
262
|
+
// Run with: node test-auth.js
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Authentication Errors
|
|
266
|
+
|
|
267
|
+
### Error: Azure AD authentication failed
|
|
268
|
+
|
|
269
|
+
**Symptoms:**
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
AADSTS70011: The provided value for the input parameter 'scope' is not valid.
|
|
273
|
+
AADSTS50105: The signed in user is not assigned to a role for the application
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
**Cause:** Azure AD application not properly configured
|
|
277
|
+
|
|
278
|
+
**Solution:**
|
|
279
|
+
|
|
280
|
+
**Step 1: Verify Azure AD app registration**
|
|
281
|
+
|
|
282
|
+
```bash
|
|
283
|
+
# Check app registration details
|
|
284
|
+
az ad app show --id your-client-id --query "{displayName:displayName,appId:appId,replyUrls:replyUrls}"
|
|
285
|
+
```
|
|
286
|
+
|
|
287
|
+
**Step 2: Update app permissions**
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
# Add Dynamics 365 permissions
|
|
291
|
+
az ad app permission add \
|
|
292
|
+
--id your-client-id \
|
|
293
|
+
--api 00000007-0000-0000-c000-000000000000 \
|
|
294
|
+
--api-permissions 78ce3f0f-a1ce-49c2-8cde-64b5c0896db4=Scope
|
|
295
|
+
|
|
296
|
+
# Grant admin consent
|
|
297
|
+
az ad app permission admin-consent --id your-client-id
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**Step 3: Verify environment URLs**
|
|
301
|
+
|
|
302
|
+
```javascript
|
|
303
|
+
// Check URL configuration
|
|
304
|
+
const config = require('./config/environments/dev.json');
|
|
305
|
+
|
|
306
|
+
const urlChecks = [
|
|
307
|
+
{ name: 'Org URL', url: config.dynamics365.orgUrl },
|
|
308
|
+
{ name: 'Web API URL', url: config.dynamics365.webApiUrl },
|
|
309
|
+
{ name: 'Tenant ID', value: config.dynamics365.tenantId },
|
|
310
|
+
];
|
|
311
|
+
|
|
312
|
+
urlChecks.forEach((check) => {
|
|
313
|
+
console.log(`${check.name}: ${check.url || check.value}`);
|
|
314
|
+
});
|
|
315
|
+
```
|
|
316
|
+
|
|
317
|
+
## Environment Setup Errors
|
|
318
|
+
|
|
319
|
+
### Error: Node.js version mismatch
|
|
320
|
+
|
|
321
|
+
**Symptoms:**
|
|
322
|
+
|
|
323
|
+
```
|
|
324
|
+
error @types/node@18.0.0: The engine "node" is incompatible with this module.
|
|
325
|
+
Expected version ">=18.0.0". Got "16.14.0"
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
**Cause:** Outdated Node.js version
|
|
329
|
+
|
|
330
|
+
**Solution:**
|
|
331
|
+
|
|
332
|
+
**Windows:**
|
|
333
|
+
|
|
334
|
+
```powershell
|
|
335
|
+
# Check current version
|
|
336
|
+
node --version
|
|
337
|
+
|
|
338
|
+
# Update using Chocolatey
|
|
339
|
+
choco upgrade nodejs
|
|
340
|
+
|
|
341
|
+
# Or using winget
|
|
342
|
+
winget upgrade OpenJS.NodeJS
|
|
343
|
+
|
|
344
|
+
# Verify update
|
|
345
|
+
node --version
|
|
346
|
+
npm --version
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
**Mac:**
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
# Check current version
|
|
353
|
+
node --version
|
|
354
|
+
|
|
355
|
+
# Update using Homebrew
|
|
356
|
+
brew upgrade node
|
|
357
|
+
|
|
358
|
+
# Or using nvm (recommended)
|
|
359
|
+
nvm install 18
|
|
360
|
+
nvm use 18
|
|
361
|
+
nvm alias default 18
|
|
362
|
+
|
|
363
|
+
# Verify update
|
|
364
|
+
node --version
|
|
365
|
+
npm --version
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
### Error: npm install fails with permission errors
|
|
369
|
+
|
|
370
|
+
**Symptoms:**
|
|
371
|
+
|
|
372
|
+
**Windows:**
|
|
373
|
+
|
|
374
|
+
```
|
|
375
|
+
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Users\...\AppData\Roaming\npm'
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
**Mac:**
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules'
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**Solution:**
|
|
385
|
+
|
|
386
|
+
**Windows:**
|
|
387
|
+
|
|
388
|
+
```powershell
|
|
389
|
+
# Configure npm for user directory
|
|
390
|
+
npm config set prefix $env:USERPROFILE\npm-global
|
|
391
|
+
npm config set cache $env:USERPROFILE\.npm-cache
|
|
392
|
+
|
|
393
|
+
# Add to PATH
|
|
394
|
+
$npmPath = "$env:USERPROFILE\npm-global"
|
|
395
|
+
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$npmPath", "User")
|
|
396
|
+
|
|
397
|
+
# Clear and verify
|
|
398
|
+
npm cache clean --force
|
|
399
|
+
npm config list
|
|
400
|
+
```
|
|
401
|
+
|
|
402
|
+
**Mac:**
|
|
403
|
+
|
|
404
|
+
```bash
|
|
405
|
+
# Fix npm permissions
|
|
406
|
+
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
|
|
407
|
+
|
|
408
|
+
# Or use nvm (recommended)
|
|
409
|
+
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
|
|
410
|
+
source ~/.zshrc
|
|
411
|
+
nvm install node
|
|
412
|
+
nvm use node
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
## Git and Version Control Errors
|
|
416
|
+
|
|
417
|
+
### Error: Line ending issues
|
|
418
|
+
|
|
419
|
+
**Symptoms:**
|
|
420
|
+
|
|
421
|
+
```
|
|
422
|
+
warning: LF will be replaced by CRLF in package.json.
|
|
423
|
+
The file will have its original line endings in your working directory
|
|
424
|
+
```
|
|
425
|
+
|
|
426
|
+
**Cause:** Different line ending conventions between Windows (CRLF) and Mac/Linux (LF)
|
|
427
|
+
|
|
428
|
+
**Solution:**
|
|
429
|
+
|
|
430
|
+
**Step 1: Configure Git globally**
|
|
431
|
+
|
|
432
|
+
**Windows:**
|
|
433
|
+
|
|
434
|
+
```powershell
|
|
435
|
+
# Configure for cross-platform team
|
|
436
|
+
git config --global core.autocrlf input
|
|
437
|
+
git config --global core.eol lf
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
**Mac:**
|
|
441
|
+
|
|
442
|
+
```bash
|
|
443
|
+
# Configure for cross-platform team
|
|
444
|
+
git config --global core.autocrlf input
|
|
445
|
+
git config --global core.eol lf
|
|
446
|
+
```
|
|
447
|
+
|
|
448
|
+
**Step 2: Add .gitattributes file**
|
|
449
|
+
|
|
450
|
+
```bash
|
|
451
|
+
# Create .gitattributes in project root
|
|
452
|
+
cat > .gitattributes << 'EOF'
|
|
453
|
+
# Auto-detect text files and perform LF normalization
|
|
454
|
+
* text=auto eol=lf
|
|
455
|
+
|
|
456
|
+
# Force specific files to use LF
|
|
457
|
+
*.js text eol=lf
|
|
458
|
+
*.ts text eol=lf
|
|
459
|
+
*.tsx text eol=lf
|
|
460
|
+
*.json text eol=lf
|
|
461
|
+
*.md text eol=lf
|
|
462
|
+
*.yml text eol=lf
|
|
463
|
+
*.yaml text eol=lf
|
|
464
|
+
|
|
465
|
+
# Force shell scripts to use LF
|
|
466
|
+
*.sh text eol=lf
|
|
467
|
+
|
|
468
|
+
# Force PowerShell scripts to use CRLF
|
|
469
|
+
*.ps1 text eol=crlf
|
|
470
|
+
|
|
471
|
+
# Binary files
|
|
472
|
+
*.png binary
|
|
473
|
+
*.jpg binary
|
|
474
|
+
*.ico binary
|
|
475
|
+
EOF
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
**Step 3: Normalize existing files**
|
|
479
|
+
|
|
480
|
+
```bash
|
|
481
|
+
# Remove all files from index
|
|
482
|
+
git rm --cached -r .
|
|
483
|
+
|
|
484
|
+
# Re-add all files with new line endings
|
|
485
|
+
git add .
|
|
486
|
+
|
|
487
|
+
# Commit the changes
|
|
488
|
+
git commit -m "fix: normalize line endings"
|
|
489
|
+
```
|
|
490
|
+
|
|
491
|
+
### Error: Case sensitivity conflicts
|
|
492
|
+
|
|
493
|
+
**Symptoms:**
|
|
494
|
+
|
|
495
|
+
```
|
|
496
|
+
error: The following untracked working tree files would be overwritten by merge:
|
|
497
|
+
src/components/myComponent.tsx
|
|
498
|
+
```
|
|
499
|
+
|
|
500
|
+
**Cause:** File renamed with different case, causing conflicts between case-sensitive (Mac) and
|
|
501
|
+
case-insensitive (Windows) systems
|
|
502
|
+
|
|
503
|
+
**Solution:**
|
|
504
|
+
|
|
505
|
+
**Step 1: Check for case conflicts**
|
|
506
|
+
|
|
507
|
+
**Windows:**
|
|
508
|
+
|
|
509
|
+
```powershell
|
|
510
|
+
# Find potential case conflicts
|
|
511
|
+
Get-ChildItem -Recurse | Group-Object Name | Where-Object {$_.Count -gt 1}
|
|
512
|
+
```
|
|
513
|
+
|
|
514
|
+
**Mac:**
|
|
515
|
+
|
|
516
|
+
```bash
|
|
517
|
+
# Find case conflicts
|
|
518
|
+
find . -type f | sort -f | uniq -di
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
**Step 2: Resolve conflicts**
|
|
522
|
+
|
|
523
|
+
```bash
|
|
524
|
+
# Rename file through Git (preserves history)
|
|
525
|
+
git mv myComponent.tsx temp-component.tsx
|
|
526
|
+
git mv temp-component.tsx MyComponent.tsx
|
|
527
|
+
git commit -m "fix: correct component case"
|
|
528
|
+
|
|
529
|
+
# Or force case change
|
|
530
|
+
git config core.ignorecase false
|
|
531
|
+
git add MyComponent.tsx
|
|
532
|
+
git rm myComponent.tsx
|
|
533
|
+
git commit -m "fix: correct component case"
|
|
534
|
+
git config core.ignorecase true
|
|
535
|
+
```
|
|
536
|
+
|
|
537
|
+
## Package Management Errors
|
|
538
|
+
|
|
539
|
+
### Error: Package-lock.json conflicts
|
|
540
|
+
|
|
541
|
+
**Symptoms:**
|
|
542
|
+
|
|
543
|
+
```
|
|
544
|
+
npm ERR! peer dep missing: react@^18.0.0, required by @types/react@18.0.0
|
|
545
|
+
```
|
|
546
|
+
|
|
547
|
+
**Cause:** Inconsistent package versions or corrupted package-lock.json
|
|
548
|
+
|
|
549
|
+
**Solution:**
|
|
550
|
+
|
|
551
|
+
**Step 1: Clean package state**
|
|
552
|
+
|
|
553
|
+
```bash
|
|
554
|
+
# Remove node_modules and package-lock.json
|
|
555
|
+
rm -rf node_modules package-lock.json # Mac/Linux
|
|
556
|
+
rmdir /s node_modules & del package-lock.json # Windows (CMD)
|
|
557
|
+
Remove-Item -Recurse -Force node_modules; Remove-Item package-lock.json # Windows (PowerShell)
|
|
558
|
+
|
|
559
|
+
# Clear npm cache
|
|
560
|
+
npm cache clean --force
|
|
561
|
+
```
|
|
562
|
+
|
|
563
|
+
**Step 2: Reinstall packages**
|
|
564
|
+
|
|
565
|
+
```bash
|
|
566
|
+
# Fresh install
|
|
567
|
+
npm install
|
|
568
|
+
|
|
569
|
+
# Verify installation
|
|
570
|
+
npm list --depth=0
|
|
571
|
+
npm audit
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
**Step 3: Fix peer dependency issues**
|
|
575
|
+
|
|
576
|
+
```bash
|
|
577
|
+
# Install missing peer dependencies
|
|
578
|
+
npm install react@^18.0.0
|
|
579
|
+
|
|
580
|
+
# Or install all peer dependencies automatically
|
|
581
|
+
npx install-peerdeps package-name
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
### Error: Native modules compilation fails
|
|
585
|
+
|
|
586
|
+
**Symptoms:**
|
|
587
|
+
|
|
588
|
+
**Windows:**
|
|
589
|
+
|
|
590
|
+
```
|
|
591
|
+
gyp ERR! find VS
|
|
592
|
+
gyp ERR! find VS msvs_version not set from command line or npm config
|
|
593
|
+
```
|
|
594
|
+
|
|
595
|
+
**Mac:**
|
|
596
|
+
|
|
597
|
+
```
|
|
598
|
+
gyp: No Xcode or CLT version detected!
|
|
599
|
+
```
|
|
600
|
+
|
|
601
|
+
**Solution:**
|
|
602
|
+
|
|
603
|
+
**Windows:**
|
|
604
|
+
|
|
605
|
+
```powershell
|
|
606
|
+
# Install Visual Studio Build Tools
|
|
607
|
+
choco install visualstudio2019buildtools
|
|
608
|
+
|
|
609
|
+
# Or configure npm to use specific VS version
|
|
610
|
+
npm config set msvs_version 2019
|
|
611
|
+
|
|
612
|
+
# Alternative: Use windows-build-tools
|
|
613
|
+
npm install --global windows-build-tools
|
|
614
|
+
```
|
|
615
|
+
|
|
616
|
+
**Mac:**
|
|
617
|
+
|
|
618
|
+
```bash
|
|
619
|
+
# Install Xcode Command Line Tools
|
|
620
|
+
xcode-select --install
|
|
621
|
+
|
|
622
|
+
# Verify installation
|
|
623
|
+
xcode-select -p
|
|
624
|
+
gcc --version
|
|
625
|
+
|
|
626
|
+
# If still failing, reset and reinstall
|
|
627
|
+
sudo xcode-select --reset
|
|
628
|
+
sudo xcode-select --install
|
|
629
|
+
```
|
|
630
|
+
|
|
631
|
+
## Runtime Errors
|
|
632
|
+
|
|
633
|
+
### Error: Module resolution fails at runtime
|
|
634
|
+
|
|
635
|
+
**Symptoms:**
|
|
636
|
+
|
|
637
|
+
```
|
|
638
|
+
Error: Cannot find module './components/MyComponent'
|
|
639
|
+
```
|
|
640
|
+
|
|
641
|
+
**Cause:** Path resolution issues between development and production environments
|
|
642
|
+
|
|
643
|
+
**Solution:**
|
|
644
|
+
|
|
645
|
+
**Step 1: Check build output**
|
|
646
|
+
|
|
647
|
+
```bash
|
|
648
|
+
# Examine built files
|
|
649
|
+
ls -la dist/
|
|
650
|
+
cat dist/index.js | grep MyComponent
|
|
651
|
+
```
|
|
652
|
+
|
|
653
|
+
**Step 2: Verify webpack configuration**
|
|
654
|
+
|
|
655
|
+
```javascript
|
|
656
|
+
// webpack.config.js
|
|
657
|
+
const path = require('path');
|
|
658
|
+
|
|
659
|
+
module.exports = {
|
|
660
|
+
resolve: {
|
|
661
|
+
alias: {
|
|
662
|
+
'@': path.resolve(__dirname, 'src'),
|
|
663
|
+
'@components': path.resolve(__dirname, 'src/components'),
|
|
664
|
+
},
|
|
665
|
+
extensions: ['.tsx', '.ts', '.js', '.jsx'],
|
|
666
|
+
},
|
|
667
|
+
};
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
**Step 3: Update TypeScript paths**
|
|
671
|
+
|
|
672
|
+
```json
|
|
673
|
+
// tsconfig.json
|
|
674
|
+
{
|
|
675
|
+
"compilerOptions": {
|
|
676
|
+
"baseUrl": ".",
|
|
677
|
+
"paths": {
|
|
678
|
+
"@/*": ["src/*"],
|
|
679
|
+
"@components/*": ["src/components/*"]
|
|
680
|
+
}
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
```
|
|
684
|
+
|
|
685
|
+
### Error: Environment variables not loaded
|
|
686
|
+
|
|
687
|
+
**Symptoms:**
|
|
688
|
+
|
|
689
|
+
```
|
|
690
|
+
TypeError: Cannot read property 'D365_CLIENT_ID' of undefined
|
|
691
|
+
```
|
|
692
|
+
|
|
693
|
+
**Cause:** Environment variables not properly loaded or configured
|
|
694
|
+
|
|
695
|
+
**Solution:**
|
|
696
|
+
|
|
697
|
+
**Step 1: Verify .env file location and format**
|
|
698
|
+
|
|
699
|
+
```bash
|
|
700
|
+
# Check .env.local exists in project root
|
|
701
|
+
ls -la .env.local
|
|
702
|
+
|
|
703
|
+
# Verify format (no spaces around =)
|
|
704
|
+
cat .env.local
|
|
705
|
+
```
|
|
706
|
+
|
|
707
|
+
**Step 2: Load environment variables correctly**
|
|
708
|
+
|
|
709
|
+
```javascript
|
|
710
|
+
// At the top of your entry file
|
|
711
|
+
require('dotenv').config({ path: '.env.local' });
|
|
712
|
+
|
|
713
|
+
// Or use different files for different environments
|
|
714
|
+
const dotenv = require('dotenv');
|
|
715
|
+
const envFile = process.env.NODE_ENV === 'production' ? '.env.prod' : '.env.local';
|
|
716
|
+
dotenv.config({ path: envFile });
|
|
717
|
+
|
|
718
|
+
// Verify variables are loaded
|
|
719
|
+
console.log('Environment variables loaded:', {
|
|
720
|
+
NODE_ENV: process.env.NODE_ENV,
|
|
721
|
+
D365_CLIENT_ID: process.env.D365_CLIENT_ID ? 'Set' : 'Missing',
|
|
722
|
+
});
|
|
723
|
+
```
|
|
724
|
+
|
|
725
|
+
**Step 3: Platform-specific environment loading**
|
|
726
|
+
|
|
727
|
+
**Windows:**
|
|
728
|
+
|
|
729
|
+
```powershell
|
|
730
|
+
# Check environment variables
|
|
731
|
+
Get-ChildItem Env: | Where-Object {$_.Name -like "*D365*"}
|
|
732
|
+
|
|
733
|
+
# Set temporarily for session
|
|
734
|
+
$env:D365_CLIENT_ID = "your-client-id"
|
|
735
|
+
|
|
736
|
+
# Set permanently
|
|
737
|
+
[Environment]::SetEnvironmentVariable("D365_CLIENT_ID", "your-client-id", "User")
|
|
738
|
+
```
|
|
739
|
+
|
|
740
|
+
**Mac:**
|
|
741
|
+
|
|
742
|
+
```bash
|
|
743
|
+
# Check environment variables
|
|
744
|
+
env | grep D365
|
|
745
|
+
|
|
746
|
+
# Set temporarily for session
|
|
747
|
+
export D365_CLIENT_ID="your-client-id"
|
|
748
|
+
|
|
749
|
+
# Set permanently
|
|
750
|
+
echo 'export D365_CLIENT_ID="your-client-id"' >> ~/.zshrc
|
|
751
|
+
source ~/.zshrc
|
|
752
|
+
```
|
|
753
|
+
|
|
754
|
+
---
|
|
755
|
+
|
|
756
|
+
This guide covers the most frequently encountered errors in cross-platform Dynamics 365 development.
|
|
757
|
+
For additional help, refer to the platform-specific troubleshooting guide or contact your team's
|
|
758
|
+
platform champions.
|