Skip to content

"Error: Access denied for product field." when following the guide using this template #23

@DawidKopys

Description

@DawidKopys

When someone tries to follow this tutorial "Build a Shopify app using Remix" with an app scaffolded by following "Scaffold and app" tutorial, then his app won't work. They are using this template.

As a result, when someone does everything as described in the guide, he ends up with Application Error:

Error: Access denied for product field. Required access: `read_products` access scope.
    at throwFailedRequest (file:///Users/dawidkopys/Workspace/shopify/flexible-tax-app/node_modules/@shopify/shopify-api/dist/esm/lib/clients/common.mjs:55:15)
    at NewGraphqlClient.request (file:///Users/dawidkopys/Workspace/shopify/flexible-tax-app/node_modules/@shopify/shopify-api/dist/esm/lib/clients/admin/graphql/client.mjs:72:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async query (file:///Users/dawidkopys/Workspace/shopify/flexible-tax-app/node_modules/@shopify/shopify-app-remix/dist/esm/server/clients/admin/graphql.mjs:13:33)
    at async supplementQRCode (/Users/dawidkopys/Workspace/shopify/flexible-tax-app/app/models/QRCode.server.js:47:20)
    at async Promise.all (index 0)
    at async loader (/Users/dawidkopys/Workspace/shopify/flexible-tax-app/app/routes/app._index.jsx:21:19)
    at async Object.callRouteLoader (/Users/dawidkopys/Workspace/shopify/flexible-tax-app/node_modules/@remix-run/server-runtime/dist/data.js:59:16)
    at async /Users/dawidkopys/Workspace/shopify/flexible-tax-app/node_modules/@remix-run/router/dist/router.cjs.js:4719:19
    at async callLoaderOrAction (/Users/dawidkopys/Workspace/shopify/flexible-tax-app/node_modules/@remix-run/router/dist/router.cjs.js:4785:16)

Image

It seems that the remix template doesn't request access scopes necessary for this app to work:

# shopify.app.toml
[access_scopes]
# Learn more at https://shopify.dev/docs/apps/tools/cli/configuration#access_scopes
scopes = ""

It seems that below actions fix the error:

  1. edit app configuration
# shopify.app.toml
[access_scopes]
# Learn more at https://shopify.dev/docs/apps/tools/cli/configuration#access_scopes
scopes = "read_products"
  1. deploy new version of your app with shopify app deploy

I believe the above steps should be included in the "Build a Shopify app using Remix" guide.

I am not sure if this is the best place to submit this issue but I hope it helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions