FROM CACHE - en_header

Getting "AppBridgeError: APP::ERROR::INVALID_CONFIG: shopOrigin

New Member
2 0 0


I'm getting this error from my app within my store and I'm not sure. I've been following the Node js and React tutorial documentation and everything has been fine, up until this point.

Server.js file:

const dotenv = require('dotenv');
const Koa = require('koa');
const next = require('next');
const { defaultcreateShopifyAuth } = require('@shopify/koa-shopify-auth');
const { verifyRequest } = require('@shopify/koa-shopify-auth');
const session = require('koa-session');


const port = parseInt(process.env.PORT, 10|| 3000;
const dev = process.env.NODE_ENV !== 'production';
const app = next({ dev });
const handle = app.getRequestHandler();


//adding routing middleware and koa server
app.prepare().then(() => {
    const server = new Koa();
        server.use(session({ securetruesameSite'none' }, server));
        server.keys = [SHOPIFY_API_SECRET_KEY];
              scopes: ['read_products'],
              afterAuth(ctx) {
                const { shopaccessToken } = ctx.session;
                  ctx.cookies.set('shopOrigin'shop, {
        server.use(async (ctx=> {
        await handle(ctx.reqctx.res);
        ctx.respond = false;
        ctx.res.statusCode = 200;
    //listens for request on port 3000
    server.listen(port, () => {
        console.log(`> Ready on http://localhost:${port}`);
import App from 'next/app';
import Head from 'next/head';
import { AppProvider } from '@shopify/polaris';
import '@shopify/polaris/dist/styles.css'//imports the polaris css styles
import translations from '@shopify/polaris/locales/en.json'//imports translates from the locales folder
import React from 'react';
import { Provider } from '@shopify/app-bridge-react';
import Cookies from 'js-cookie';

class MyApp extends App {
  render() {
    const { ComponentpageProps } = this.props;
    const config = { apiKey: API_KEY, shopOriginCookies.get("shopOrigin"), forceRedirecttrue };
    return (
          <title>Sample App</title>
          <meta charSet="utf-8" />
        <Provider config={config}>
          <AppProvider i18n={translations}>
          <Component {...pageProps} />
export default MyApp;
If anyone could give me some guidance that would be highly appreciated; I just want to continue to learn app development within Shopify, but this annoying error is hindering me from doing so.
I tested it on Firefox to see if it would work, but I got the same error.


This is what I found in the console.....



Reply 1 (1)
New Member
2 0 0

Following up from yesterday, after my ngrok session expired, I re-authenticated my app in my store admin today with a new  App URL and now everything is working. I'm not sure why that's the case, if anyone has incite, would you mind sharing?