Physical scanner no longer works on non-initial pages

Example snippet:

export function ExampleTwo() {
  if (navigation.currentEntry.url === "/scanner") {
    return (
      <s-page heading="Scanner page">
        <ExampleScannerPage />
      </s-page>
    );
  }

  return (
    <s-page heading="Default page">
      <s-button onClick={() => navigation.navigate("/scanner")}>
        Go to scanner page
      </s-button>
    </s-page>
  );
}

function ExampleScannerPage() {
  const [scannedValue, setScannedValue] = useState("");
  useEffect(() => {
    const unsubscribeScanner = shopify.scanner.scannerData.current.subscribe(
      async ({ data }) => {
        if (!data) return;

        shopify.toast.show(`Scanned: "${data}"`);
        setScannedValue(data);
      }
    );

    return () => unsubscribeScanner();
  }, []);

  return <s-text>Scanned Value: {scannedValue}</s-text>;
}

To reproduce:

  1. Go to scanner page
  2. Scan with a physical scanner. I used Socket Mobile 2D.

After scanning, the scanner beeps, indicating an error - the same sound when the product’s barcode isn’t recognised in native POS. scannedValue remains blank.

Note that the physical scanner works from the initial page. To verify, replace navigation.currentEntry.url === "/scanner" with navigation.currentEntry.url === "/" and scan after loading the extension’s modal.

This was reproduced on version 2026-01, pos.home.modal.render target.

This works fine in production, version 2025-07.

@Galmis Hey, what version of POS are you on? We recently shipped a fix for that exact issue. For extra context, both 2025-10 and 2026-01 were impacted, the fix should be in POS 11.2.0.

Hi @JS_Goupil. I was using version 11.0.3. It’s fixed in the newest version 11.2.0. Thanks!

@Galmis thank you for confirming!

1 Like