Skip to content

Describe how to use the POS log streaming #2946

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: unstable
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,36 @@ const data: LandingTemplateSchema = {
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.

### APIs
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.
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.

### Components

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.

**In the future we plan to modify this behavior to display the error in the Chrome console instead, aligning with the API approach.**`,
**In the future we plan to modify this behavior to display the error in the console instead, aligning with the API approach.**`,
},
{
type: 'Generic',
anchorLink: 'accessing-the-console',
title: 'Accessing the console',
sectionContent: `
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.

### How it works
1. Ensure you are using at least version 3.82 of the Shopify CLI and version 10.XXXXXX of the POS app.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: update this with the POS version EH is stable on


2. Launch your extension in development mode: \`shopify app dev\`

3. 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.

### Benefits
- Console logs are viewable without connecting a test device to a computer
- Real-time console log viewing while developing extensions without having to open the browser dev tools
- Standard browser console logging statements work in extension code

### Limitations

- Console logs are only available when running \`shopify app dev\`. They are not available for production extensions.`,
},
{
type: 'Generic',
Expand Down