Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi! I'm new to Shopify development, so this is probably a simple question. I made a shopify app that has a working front-end, back-end, and a theme extension (page widget). So it's structured something like this:
extensions page-widget assets block.js blocks block.liquid shopify.theme.extension.toml web package.json frontend package.json package.json
The block.js file is linked to the block.liquid file in the liquid file schema.
However when I run my app locally, and open the extension in my development store, I get the "Uncaught SyntaxError: Cannot use import statement outside a module" error on my block.js file because I have an import statement there:
import { useAppQuery } from "../../../web/frontend/hooks";
I have 3 package.json files, and each has "theme": "module", so I'm not sure what else to try? It's only getting triggered in the block.js file and not any of the other .js files I have...
Discover how to increase customer engagement on your store with articles from Shopify A...
By Jacqui Apr 23, 2025Hey Community 👋 Did you know that March 15th is National Everything You Think Is W...
By JasonH Apr 1, 2025Discover how to increase the efficiency of commerce operations with Shopify Academy's l...
By Jacqui Mar 26, 2025