In server.js I have this code:
import '@shopify/shopify-app-remix/server/adapters/node';
import {
LATEST_API_VERSION,
shopifyApp,
} from '@shopify/shopify-app-remix/server';
if (!process.env.SHOPIFY_API_KEY || !process.env.SHOPIFY_API_SECRET || !process.env.SHOPIFY_APP_URL) {
throw new Error('Environment variables not defined');
}
export const shopifyTEST = shopifyApp({
apiKey: process.env.SHOPIFY_API_KEY,
apiSecretKey: process.env.SHOPIFY_API_SECRET,
appUrl: process.env.SHOPIFY_APP_URL,
scopes: ['read_analytics'],
apiVersion: LATEST_API_VERSION,
});
shopify-app-remix is installed via npm, but running the code npm run dev I see the following errors about crypto
X [ERROR] Could not resolve "crypto"
node_modules/@shopify/shopify-app-remix/build/cjs/server/adapters/node/index.js:3:21:
3 │ var crypto = require('crypto');
╵ ~~~~~~~~
The package "crypto" wasn't found on the file system but is built into node. Are you trying to bundle for node? You can use "platform: 'node'" to do that, which will remove this error.
I didn’t want to execute platform 'node' unless I was certain this is the direction I wanted go. Any ideas?
Thanks