Closed FlorianB385 closed 1 year ago
Having this exact issue as well. Been scouring the Shopify docs to see if I missed anything to no avail.
Also encountered this. I assume this has to do with not importing the relevant node adapters
import '@shopify/shopify-api/adapters/node'
Can anyone confirm?
Yes, that error is an indication that the adapter hasn't been loaded before the first call to shopifyApi
(https://github.com/Shopify/shopify-api-js/blob/main/docs/migrating-to-v6.md#migrating-to-v6).
import '@shopify/shopify-api/adapters/node';
import { ... } from '@shopify/shopify-api';
StorefrontClient: Using a private storefront token is recommended for server environments. Refer to the authentication https://shopify.dev/api/storefront#authentication documentation for more details. ReferenceError: process is not defined at nodeRuntimeString (/Users/jamalsoueidan/Development/storefront/node_modules/@shopify/shopify-api/adapters/node/adapter.ts:92:18) Remix.
Still getting this error with @shopify/shopify-api": "7.5.1
ReferenceError: process is not defined
at nodeRuntimeString (.../node_modules/@shopify/shopify-api/adapters/node/adapter.ts:92:18)
at shopifyApi2 (.../node_modules/@shopify/shopify-api/lib/index.ts:77:62)
at Object.fetch (.../server.ts:70:23)
at ServiceWorkerGlobalScope.[kDispatchFetch] (.../node_modules/@miniflare/core/src/standards/event.ts:385:13)
at /.../node_modules/@shopify/mini-oxygen/dist/mini-oxygen/server.js:146:24
I want to confirm that it will work if you import the library as with an await inside a nitro plugin
export default defineNitroPlugin(async (nitroApp) => { await import('@shopify/shopify-api/adapters/node') })
This way, the adapter is registered and work for Nuxt server functions with Nitro
I want to confirm that it will work if you import the library as with an await inside a nitro plugin
export default defineNitroPlugin(async (nitroApp) => { await import('@shopify/shopify-api/adapters/node') })
This way, the adapter is registered and work for Nuxt server functions with Nitro
@BYohann
I'm doing it the exact same way in a Nitro plugin and still getting the same error => "Error: Missing adapter implementation for 'abstractRuntimeString'"
Is this way what you are currently using?
Thanks.
I want to confirm that it will work if you import the library as with an await inside a nitro plugin export default defineNitroPlugin(async (nitroApp) => { await import('@shopify/shopify-api/adapters/node') }) This way, the adapter is registered and work for Nuxt server functions with Nitro
@BYohann
I'm doing it the exact same way in a Nitro plugin and still getting the same error => "Error: Missing adapter implementation for 'abstractRuntimeString'"
Is this way what you are currently using?
Thanks.
Create a middleware server like server/middleware/shopifyAdapters.js
with:
export default defineEventHandler((event) => {
import("@shopify/shopify-api/adapters/node");
});
This worked for me
I want to confirm that it will work if you import the library as with an await inside a nitro plugin export default defineNitroPlugin(async (nitroApp) => { await import('@shopify/shopify-api/adapters/node') }) This way, the adapter is registered and work for Nuxt server functions with Nitro
@BYohann I'm doing it the exact same way in a Nitro plugin and still getting the same error => "Error: Missing adapter implementation for 'abstractRuntimeString'" Is this way what you are currently using? Thanks.
Create a middleware server like
server/middleware/shopifyAdapters.js
with:export default defineEventHandler((event) => { import("@shopify/shopify-api/adapters/node"); });
This worked for me
Thank you!
Hi! We would like to build an simple Shopify App in nuxt3. After installation and configuration, we call the shopifyApi function. Then the error occurs. Some issue report says, that we import first "@shopify/shopify-api/adapters/node" but that didn't help either.
@shopify/shopify-api
version: 6.2.0