You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
APIs and components will report if they receive parameters of an unexpected type. For further debugging, you can use \`console.log\` to print any additional information in the console.
20
20
21
21
### APIs
22
-
If an API receives an incorrect parameter, it won't attempt to perform the action and it will \`throw\` an error instead. This error can be viewed either by implementing a \`try/catch\` block or by using the Chrome console.
22
+
If an API receives an incorrect parameter, it won't attempt to perform the action and it will \`throw\` an error instead. This error can be viewed either by implementing a \`try/catch\` block or by using the browser console.
23
23
24
24
### Components
25
25
26
26
If a component is given an incorrect parameter, the extension will be replaced with a non-descriptive user interface that indicates an issue has occurred. In case the extension is running locally, the developer will also see the exact error displayed as a toast message.
27
27
28
-
**In the future we plan to modify this behavior to display the error in the Chrome console instead, aligning with the API approach.**`,
28
+
**In the future we plan to modify this behavior to display the error in the console instead, aligning with the API approach.**`,
29
+
},
30
+
{
31
+
type: 'Generic',
32
+
anchorLink: 'accessing-the-console',
33
+
title: 'Accessing the console',
34
+
sectionContent: `
35
+
You can now view your POS UI Extension's JavaScript console output (\`console.log\`, etc.) directly in your terminal when running \`shopify app dev\`. This feature doesn't require your test device to be physically connected to your computer.
36
+
37
+
### How it works
38
+
1. Launch your extension in development mode: \`shopify app dev\`
39
+
40
+
2. As your extension runs in the Shopify POS app on your test device, any console logging statements you use (such as \`console.log("My data", data);\`) will appear in the terminal output where you launched shopify app dev.
41
+
42
+
### Benefits
43
+
- Console logs are viewable without connecting a test device to a computer
44
+
- Real-time console log viewing while developing extensions without having to open the browser dev tools
45
+
- Standard browser console logging statements work in extension code
46
+
47
+
### Limitations
48
+
49
+
- Console logs are only available when running \`shopify app dev\`. They are not available for production extensions.
50
+
- Network requests are not supported in the console. To view network requests, you can use the browser dev tools or manually log the network requests in your code.`,
0 commit comments