microsoft/vscode-react-native

Public

mirrored fromhttps://github.com/microsoft/vscode-react-nativeAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
86dcbe999800c04156b175830e31fc6a31a0db3a

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

src/common/error/errorStrings.ts

353lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for details.
3import * as nls from "vscode-nls";
4import { InternalErrorCode } from "./internalErrorCode";
5nls.config({
6 messageFormat: nls.MessageFormat.bundle,
7 bundleFormat: nls.BundleFormat.standalone,
8})();
9const localize = nls.loadMessageBundle();
10
11export const ERROR_STRINGS = {
12 [InternalErrorCode.CommandFailed]: localize(
13 "CommandFailed",
14 "Error while executing command '{0}'",
15 ),
16 [InternalErrorCode.CommandFailedWithDetails]: localize(
17 "CommandFailed",
18 "Error while executing command '{0}'.\nDetails: {1}",
19 ),
20 [InternalErrorCode.CommandFailedWithErrorCode]: localize(
21 "CommandFailedWithErrorCode",
22 "Command '{0}' failed with error code {1}",
23 ),
24 [InternalErrorCode.ExpectedIntegerValue]: localize(
25 "ExpectedIntegerValue",
26 "Expected an integer. Couldn't read {0}",
27 ),
28 [InternalErrorCode.PackagerStartFailed]: localize(
29 "PackagerStartFailed",
30 "Error while executing React Native Packager.",
31 ),
32 [InternalErrorCode.IOSDeployNotFound]: localize(
33 "IOSDeployNotFound",
34 "Unable to find ios-deploy. Please make sure to install it globally('npm install -g ios-deploy')",
35 ),
36 [InternalErrorCode.DeviceNotPluggedIn]: localize(
37 "DeviceNotPluggedIn",
38 "Unable to mount developer disk image.",
39 ),
40 [InternalErrorCode.DeveloperDiskImgNotMountable]: localize(
41 "DeveloperDiskImgNotMountable",
42 "Unable to mount developer disk image.",
43 ),
44 [InternalErrorCode.ApplicationLaunchFailed]: localize(
45 "ApplicationLaunchFailed",
46 "An error occurred while launching the application. {0}",
47 ),
48 [InternalErrorCode.CouldNotAttachToDebugger]: localize(
49 "CouldNotAttachToDebugger",
50 "An error occurred while attaching debugger to the application. {0}",
51 ),
52 [InternalErrorCode.ApplicationLaunchTimedOut]: localize(
53 "ApplicationLaunchTimedOut",
54 "Timeout launching application. Is the device locked?",
55 ),
56 [InternalErrorCode.IOSSimulatorNotLaunchable]: localize(
57 "IOSSimulatorNotLaunchable",
58 "Unable to launch iOS simulator. Try specifying a different target.",
59 ),
60 [InternalErrorCode.OpnPackagerLocationNotFound]: localize(
61 "OpnPackagerLocationNotFound",
62 "Opn package location not found",
63 ),
64 [InternalErrorCode.OpnPackagerNotFound]: localize(
65 "OpnPackagerNotFound",
66 "The package 'opn' was not found. {0}",
67 ),
68 [InternalErrorCode.PackageNotFound]: localize(
69 "PackageNotFound",
70 "Attempting to find package {0} failed with error: {1}",
71 ),
72 [InternalErrorCode.PlatformNotSupported]: localize(
73 "PlatformNotSupported",
74 "Platform '{0}' is not supported on host platform: {1}",
75 ),
76 [InternalErrorCode.ProjectVersionNotParsable]: localize(
77 "ProjectVersionNotParsable",
78 "Couldn't parse the version component of the package at {0}: version = {1}",
79 ),
80 [InternalErrorCode.ProjectVersionUnsupported]: localize(
81 "ProjectVersionUnsupported",
82 "Project version = {0}",
83 ),
84 [InternalErrorCode.CouldNotFindProjectVersion]: localize(
85 "CouldNotFindProjectVersion",
86 "Couldn't find React Native version in the current workspace or folder",
87 ),
88 [InternalErrorCode.ProjectVersionNotReadable]: localize(
89 "ProjectVersionNotReadable",
90 "Unable to read version = {0}",
91 ),
92 [InternalErrorCode.TelemetryInitializationFailed]: localize(
93 "TelemetryInitializationFailed",
94 "{0}. Couldn't initialize telemetry",
95 ),
96 [InternalErrorCode.ExtensionActivationFailed]: localize(
97 "ExtensionActivationFailed",
98 "Failed to activate the React Native Tools extension",
99 ),
100 [InternalErrorCode.DebuggerStubLauncherFailed]: localize(
101 "DebuggerStubLauncherFailed",
102 "Failed to setup the stub launcher for the debugger",
103 ),
104 [InternalErrorCode.IntellisenseSetupFailed]: localize(
105 "IntellisenseSetupFailed",
106 "Failed to setup IntelliSense",
107 ),
108 [InternalErrorCode.NodeDebuggerConfigurationFailed]: localize(
109 "NodeDebuggerConfigurationFailed",
110 "Failed to configure the node debugger location for the debugger",
111 ),
112 [InternalErrorCode.FailedToStopPackagerOnExit]: localize(
113 "FailedToStopPackagerOnExit",
114 "Failed to stop the packager while closing React Native Tools",
115 ),
116 [InternalErrorCode.FailedToRunOnAndroid]: localize(
117 "FailedToRunOnAndroid",
118 "Failed to run the application in Android",
119 ),
120 [InternalErrorCode.FailedToRunOnIos]: localize(
121 "FailedToRunOnIos",
122 "Failed to run the application in iOS",
123 ),
124 [InternalErrorCode.FailedToRunExponent]: localize(
125 "FailedToRunExponent",
126 "Failed to run the application in Expo",
127 ),
128 [InternalErrorCode.FailedToPublishToExpHost]: localize(
129 "FailedToRunExponent",
130 "Failed to publish the application to Exponent",
131 ),
132 [InternalErrorCode.FailedToStartPackager]: localize(
133 "FailedToStartPackager",
134 "Failed to start the React Native packager",
135 ),
136 [InternalErrorCode.FailedToStopPackager]: localize(
137 "FailedToStopPackager",
138 "Failed to stop the React Native packager",
139 ),
140 [InternalErrorCode.FailedToRestartPackager]: localize(
141 "FailedToRestartPackager",
142 "Failed to restart the React Native packager",
143 ),
144 [InternalErrorCode.DebuggingFailed]: localize("DebuggingFailed", "Cannot debug application"),
145 [InternalErrorCode.DebuggingFailedInNodeWrapper]: localize(
146 "DebuggingFailedInNodeWrapper",
147 "Cannot debug application due to an error in the internal Node Debugger",
148 ),
149 [InternalErrorCode.RNTempFolderDeletionFailed]: localize(
150 "RNTempFolderDeletionFailed",
151 "Couldn't delete the temporary folder {0}",
152 ),
153 [InternalErrorCode.CouldNotFindLocationOfNodeDebugger]: localize(
154 "CouldNotFindLocationOfNodeDebugger",
155 "Couldn't find the location of the node-debugger extension",
156 ),
157 [InternalErrorCode.CouldNotFindWorkspace]: localize(
158 "CouldNotFindWorkspace",
159 "Couldn't find any workspace or React Native project folder",
160 ),
161 [InternalErrorCode.ReactNativePackageIsNotInstalled]: localize(
162 "ReactNativePackageIsNotInstalled",
163 'Couldn\'t find react-native package in node_modules. Please, run "npm install" inside your project to install it.',
164 ),
165 [InternalErrorCode.ReactNativeWindowsIsNotInstalled]: localize(
166 "ReactNativeWindowsIsNotInstalled",
167 "It appears you don't have 'react-native-windows' package installed. Please proceed to https://github.com/microsoft/react-native-windows#getting-started for more info.",
168 ),
169 [InternalErrorCode.PackagerRunningInDifferentPort]: localize(
170 "PackagerRunningInDifferentPort",
171 "A packager cannot be started on port {0} because a packager process is already running on port {1}",
172 ),
173 [InternalErrorCode.ErrorWhileProcessingMessageInIPMSServer]: localize(
174 "ErrorWhileProcessingMessageInIPMSServer",
175 "An error ocurred while handling message: {0}",
176 ),
177 [InternalErrorCode.ErrorNoPipeFound]: localize(
178 "ErrorNoPipeFound",
179 "Unable to set up communication with VSCode react-native extension. Is this a react-native project, and have you made sure that the react-native npm package is installed at the root?",
180 ),
181 [InternalErrorCode.NotAllSuccessPatternsMatched]: localize(
182 "NotAllSuccessPatternsMatched",
183 'Unknown error: not all success patterns were matched. \n It means that "react-native run-{0}" command failed. \n Please, check the View -> Toggle Output -> React Native, \n View -> Toggle Output -> React Native: Run {1} output windows.',
184 ),
185 [InternalErrorCode.CouldNotParsePackageVersion]: localize(
186 "CouldNotParsePackageVersion",
187 "Couldn't parse the version component of the package at {0}: version = {1}",
188 ),
189 [InternalErrorCode.UnsupportedCommandStatus]: localize(
190 "UnsupportedCommandStatus",
191 "Unsupported command status",
192 ),
193 [InternalErrorCode.ExpectedExponentTunnelPath]: localize(
194 "ExpectedExponentTunnelPath",
195 "No link provided by Expo. Is your project correctly setup?",
196 ),
197 [InternalErrorCode.WorkspaceNotFound]: localize(
198 "WorkspaceNotFound",
199 "Error while working with workspace: {0}",
200 ),
201 [InternalErrorCode.RNVersionNotSupportedByExponent]: localize(
202 "RNVersionNotSupportedByExponent",
203 "React Native version not supported by Expo. Major versions supported: {0}",
204 ),
205 [InternalErrorCode.UserCancelledExpoLogin]: localize(
206 "UserCancelledExpoLogin",
207 "User canceled login.",
208 ),
209 [InternalErrorCode.NgrokIsNotInstalledGlobally]: localize(
210 "NgrokIsNotInstalledGlobally",
211 'It seems that "@expo/ngrok" package isn\'t installed globally. This package is required to use Expo tunnels. Please run "npm i -g @expo/ngrok" to install it globally.',
212 ),
213 [InternalErrorCode.CannotAttachToPackagerCheckPackagerRunningOnPort]: localize(
214 "CannotAttachToPackagerCheckPackagerRunningOnPort",
215 "Cannot attach to packager. Are you sure there is a packager and it is running in the port {0}? If your packager is configured to run in another port make sure to add that to the settings.json.",
216 ),
217 [InternalErrorCode.AnotherDebuggerConnectedToPackager]: localize(
218 "AnotherDebuggerConnectedToPackager",
219 "Another debugger is already connected to packager. Please close it before trying to debug with VSCode.",
220 ),
221 [InternalErrorCode.NotInReactNativeFolderError]: localize(
222 "NotInReactNativeFolderError",
223 "Seems to be that you are trying to debug from within directory that is not a React Native project root. \n If so, please, follow these instructions: https://github.com/microsoft/vscode-react-native#customization",
224 ),
225 [InternalErrorCode.SourcesStoragePathIsNullOrEmpty]: localize(
226 "SourcesStoragePathIsNullOrEmpty",
227 "The sourcesStoragePath argument was null or empty",
228 ),
229 [InternalErrorCode.AndroidCouldNotInstallTheAppOnAnyAvailibleDevice]: localize(
230 "AndroidCouldNotInstallTheAppOnAnyAvailibleDevice",
231 "Could not install the app on any available device. Make sure you have a correctly \n configured device or emulator running. See https://facebook.github.io/react-native/docs/android-setup.html.",
232 ),
233 [InternalErrorCode.AndroidShellCommandTimedOut]: localize(
234 "AndroidShellCommandTimedOut",
235 "An Android shell command timed-out. Please retry the operation.",
236 ),
237 [InternalErrorCode.AndroidProjectNotFound]: localize(
238 "AndroidProjectNotFound",
239 "Android project not found.",
240 ),
241 [InternalErrorCode.AndroidMoreThanOneDeviceOrEmulator]: localize(
242 "AndroidMoreThanOneDeviceOrEmulator",
243 "More than one device/emulator",
244 ),
245 [InternalErrorCode.AndroidFailedToLaunchTheSpecifiedActivity]: localize(
246 "AndroidFailedToLaunchTheSpecifiedActivity",
247 "Failed to launch the specified activity. Try running application manually and start debugging using 'Attach to packager' launch configuration.",
248 ),
249 [InternalErrorCode.IOSFoundMoreThanOneExecutablesCleanupBuildFolder]: localize(
250 "IOSFoundMoreThanOneExecutablesCleanupBuildFolder",
251 "Found more than one executables in {0}. Please cleanup build folder or setup 'productName' launch option.",
252 ),
253 [InternalErrorCode.IOSCouldNotFoundExecutableInFolder]: localize(
254 "IOSCouldNotFoundExecutableInFolder",
255 "Could not found executable in {0}",
256 ),
257 [InternalErrorCode.WinRNMPPluginIsNotInstalled]: localize(
258 "WinRNMPPluginIsNotInstalled",
259 "'rnpm-plugin-windows' is not installed.",
260 ),
261 [InternalErrorCode.WinRunCommandFailed]: localize(
262 "WinRunCommandFailed",
263 "{0}\nPlease check the 'React Native: Run Windows' output channel for detales",
264 ),
265 [InternalErrorCode.ReactDevtoolsIsNotInstalled]: localize(
266 "ReactDevtoolsIsNotInstalled",
267 "React Devtools is not installed. Run `npm install -g react-devtools` command in your terminal to install it.",
268 ),
269 [InternalErrorCode.CancellationTokenTriggered]: localize(
270 "CancellationTokenTriggered",
271 "Operation canceled",
272 ),
273 [InternalErrorCode.WorkspaceIsNotTrusted]: localize(
274 "WorkspaceIsNotTrusted",
275 'The workspace by the project path "{0}" should be trusted to use "{1}"',
276 ),
277 [InternalErrorCode.DebuggingWontWorkReloadJSAndReconnect]: localize(
278 "DebuggingWontWorkReloadJSAndReconnect",
279 "{0}. Debugging won't work: Try reloading the JS from inside the app, or Reconnect the VS Code debugger",
280 ),
281 [InternalErrorCode.ReconnectionToPackagerFailedCheckForErrorsOrRestartReactNative]: localize(
282 "ReconnectionToPackagerFailedCheckForErrorsOrRestartReactNative",
283 "Reconnection to the proxy (Packager) failed. Please check the output window for Packager errors, if any. If failure persists, please restart the React Native debugger.",
284 ),
285 [InternalErrorCode.FailedToProcessMessageFromReactNativeApp]: localize(
286 "FailedToProcessMessageFromReactNativeApp",
287 "Failed to process message from the React Native app. Message:\n{0}",
288 ),
289 [InternalErrorCode.FailedToPrepareJSRuntimeEnvironment]: localize(
290 "FailedToPrepareJSRuntimeEnvironment",
291 "Failed to prepare the JavaScript runtime environment. Message:\n{0}",
292 ),
293 [InternalErrorCode.FailedToSendMessageToTheReactNativeApp]: localize(
294 "FailedToSendMessageToTheReactNativeApp",
295 "Failed to send message to the React Native app. Message:\n{0}",
296 ),
297 [InternalErrorCode.ReactNativeWorkerProcessThrownAnError]: localize(
298 "ReactNativeWorkerProcessThrownAnError",
299 "React Native worker process thrown an error",
300 ),
301 [InternalErrorCode.CouldntImportScriptAt]: localize(
302 "CouldntImportScriptAt",
303 "Couldn't import script at <{0}>",
304 ),
305 [InternalErrorCode.RNMessageWithMethodExecuteApplicationScriptDoesntHaveURLProperty]: localize(
306 "RNMessageWithMethodExecuteApplicationScriptDoesntHaveURLProperty",
307 "RNMessage with method 'executeApplicationScript' doesn't have 'url' property",
308 ),
309 [InternalErrorCode.CouldNotConnectToDebugTarget]: localize(
310 "CouldNotConnectToDebugTarget",
311 "Could not connect to the debug target at {0}: {1}",
312 ),
313 [InternalErrorCode.IOSCouldNotFoundDeviceForDirectDebugging]: localize(
314 "CannotAttachtoiOSDeviceDirectly",
315 'Unable to find iOS target device/simulator. Please check that "Settings > Safari > Advanced > Web Inspector = ON" or try specifying a different "port" parameter in launch.json. Also, please make sure that \'target\' property in your debug scenario is defined correctly.',
316 ),
317 [InternalErrorCode.FailedToStartAndroidEmulator]: localize(
318 "FailedToStartAndroidEmulator",
319 'The command "emulator -avd {0}" threw an exception: {1}',
320 ),
321 [InternalErrorCode.VirtualDeviceSelectionError]: localize(
322 "VirtualDeviceSelectionError",
323 "Virtual device launch finished with an exception: {0}",
324 ),
325 [InternalErrorCode.ReactNativemacOSIsNotInstalled]: localize(
326 "ReactNativemacOSIsNotInstalled",
327 "It appears you don't have 'react-native-macos' package installed. Please proceed to https://microsoft.github.io/react-native-windows/docs/rnm-getting-started for more info.",
328 ),
329 [InternalErrorCode.AndroidCouldNotStartLogCatMonitor]: localize(
330 "ErrorWhileStartMonitoringLogCat",
331 "Error while starting monitoring LogCat",
332 ),
333 [InternalErrorCode.AndroidCouldNotStopLogCatMonitor]: localize(
334 "ErrorWhileStopMonitoringLogCat",
335 "Error while stopping monitoring LogCat",
336 ),
337 [InternalErrorCode.AndroidCouldNotFindActiveLogCatMonitor]: localize(
338 "ErrorWhileSelectMonitoringLogCat",
339 "No active Android LogCat monitors found",
340 ),
341 [InternalErrorCode.CouldNotDirectDebugWithoutHermesEngine]: localize(
342 "CouldNotDirectDebugWithoutHermesEngine",
343 "Could not start direct debugging of the {0} application without Hermes engine enabled. Please check if Hermes engine is enabled in your project and your debugging configuration contains 'useHermesEngine' prop set to 'true'",
344 ),
345 [InternalErrorCode.CouldNotStartNetworkInspector]: localize(
346 "ErrorWhileStartNetworkInspector",
347 "Error while starting Network inspector",
348 ),
349 [InternalErrorCode.CouldNotStopNetworkInspector]: localize(
350 "ErrorWhileStopNetworkInspector",
351 "Error while stopping Network inspector",
352 ),
353};
354