Skip to content

Commit 50e29ad

Browse files
committed
Describe how to use the POS log streaming
1 parent 258fdd1 commit 50e29ad

File tree

1 file changed

+24
-2
lines changed
  • packages/ui-extensions/docs/surfaces/point-of-sale/staticPages/pages

1 file changed

+24
-2
lines changed

packages/ui-extensions/docs/surfaces/point-of-sale/staticPages/pages/debugging.doc.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,35 @@ const data: LandingTemplateSchema = {
1919
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.
2020
2121
### 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.
2323
2424
### Components
2525
2626
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.
2727
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.`,
2951
},
3052
{
3153
type: 'Generic',

0 commit comments

Comments
 (0)