Skip to content

Nuxt 3.16 - Missing adapter implementation for 'abstractRuntimeString' - make sure to import the appropriate adapter for your platform #2289

@Zelfapp

Description

@Zelfapp

Issue summary

Before opening this issue, I have:

  • Upgraded to the latest version of the relevant packages
    • @shopify/* package and version: "@shopify/shopify-api": "^11.11.1"
    • Node version: 22.14.0
    • Operating system: Ubuntu 22
  • Looked for similar issues in this repository

I'm running a Nuxt 3.16 application. See code below, which in the Nuxt world is a server API. When initializing the shopifyApi(), I'm getting the error:

Missing adapter implementation for 'abstractRuntimeString' - make sure to import the appropriate adapter for your platform

I've attempted to import the node and web-api, but the error persists. Any ideas with Nuxt on how to overcome this adapter issue?

import '@shopify/shopify-api/adapters/node'
import { ApiVersion, shopifyApi } from '@shopify/shopify-api'
import { process } from 'std-env'

export default defineEventHandler(async event => {
  try {
    const SHOPIFY_API_KEY = process.env.SHOPIFY_CLIENT_ID
    const SHOPIFY_API_SECRET = process.env.SHOPIFY_CLIENT_SECRET
    const SHOPIFY_REDIRECT_URI = process.env.SHOPIFY_REDIRECT_URI

    if (!SHOPIFY_API_KEY || !SHOPIFY_API_SECRET || !SHOPIFY_REDIRECT_URI) {
      throw new Error(
        'Invalid Shopify credentials. Please set SHOPIFY_CLIENT_ID and SHOPIFY_CLIENT_SECRET in your environment variables.',
      )
    }

    const SCOPES = ['read_products', 'write_products', 'read_orders', 'write_orders']

    const body = await readBody(event)
    const { storeName } = body

    if (!storeName) {
      throw createError({
        statusCode: 400,
        statusMessage: 'Missing shop URL',
      })
    }

    // Initialize Shopify API
    // https://github.com/Shopify/shopify-app-js/blob/main/packages/apps/shopify-api/docs/reference/shopifyApi.md
    const shopify = shopifyApi({
      apiKey: SHOPIFY_API_KEY,
      apiSecretKey: SHOPIFY_API_SECRET,
      scopes: SCOPES,
      hostName: SHOPIFY_REDIRECT_URI,
      apiVersion: ApiVersion.January25,
      isEmbeddedApp: false,
    })

    // Clean up the shop URL to ensure it's just the domain
    const shop = shopify.utils.sanitizeShop(storeName, true)
    if (!shop) {
      throw createError({
        statusCode: 400,
        statusMessage: 'Invalid shop URL',
      })
    }

    // Create a new auth session
    const callbackPath = '/api/shopify/callback'

    // Generate the authorization URL
    const authSession = await shopify.auth.begin({
      shop,
      callbackPath,
      isOnline: false,
      rawRequest: event.node.req,
    })

    return {
      success: true,
      redirectUrl: authSession,
    }
  } catch (error) {
    const errorMessage =
      error instanceof Error ? error.message : 'Failed to start Shopify installation'

    throw createError({
      statusCode: 500,
      statusMessage: errorMessage,
      data: error,
    })
  }
})

Activity

ghardin1314

ghardin1314 commented on Apr 2, 2025

@ghardin1314

Running into the same exact issue using tanstack start. I think it has something to do with the underlying Nitro server

mateuszstonawski

mateuszstonawski commented on Apr 7, 2025

@mateuszstonawski

Also running into the same issue when using Next.js

pevin

pevin commented on Apr 24, 2025

@pevin

I ran into the same issue after upgrading to @shopify/shopify-api v11. Wasn't even able to import @shopify/shopify-api/adapters/node -- it says Unable to resolve path to module

Would really appreciate some traction on this issue.

EDIT: the app is running in nestjs

AhmedKaram50

AhmedKaram50 commented on May 12, 2025

@AhmedKaram50

Same Problem with me

"nuxt": "^3.17.2",
"@shopify/shopify-api": "^11.12.0",

linked a pull request that will close this issue on May 20, 2025
github-actions

github-actions commented on Jul 12, 2025

@github-actions
Contributor

We're labeling this issue as stale because there hasn't been any activity on it for 60 days. While the issue will stay open and we hope to resolve it, this helps us prioritize community requests.

You can add a comment to remove the label if it's still relevant, and we can re-evaluate it.

djordje-st

djordje-st commented on Aug 2, 2025

@djordje-st

This is still an issue. I'm using the latest version on TanStack Start.

djordje-st

djordje-st commented on Aug 2, 2025

@djordje-st

Found a workaround, add these to your vite config file:

export default defineConfig({
  ...
  optimizeDeps: {
    include: ['@shopify/app-bridge-react', '@shopify/shopify-api'],
  },
  ssr: {
    noExternal: ['@shopify/shopify-api'],
  },
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @djordje-st@Zelfapp@pevin@ghardin1314@AhmedKaram50

      Issue actions

        Nuxt 3.16 - Missing adapter implementation for 'abstractRuntimeString' - make sure to import the appropriate adapter for your platform · Issue #2289 · Shopify/shopify-app-js