Git Product home page Git Product logo

kinngh / shopify-node-express-mongodb-app Goto Github PK

View Code? Open in Web Editor NEW
281.0 281.0 94.0 271 KB

An embedded Shopify app starter template made with Node, Express, React and Vite, with all the required stuff hooked up.

Home Page: https://x.com/kinngh

License: MIT License

JavaScript 99.94% HTML 0.06%
boilerplate shopify shopify-api shopify-app shopify-app-node shopify-app-node-mongodb shopify-apps

shopify-node-express-mongodb-app's Introduction

Hi there 👋

I am Harshdeep Singh Hura.

Starting out as an iOS developer, I scaled my app WrapItUp to 4M+ users without a single dollar in marketing! Read more about it on my Medium post.

I am a full stack JavaScript developer with a focus on creating storefronts and applications on Shopify and Shopify Plus. I prefer shipping features and products instead of being busy with boilerplate code.

Work

Socials

shopify-node-express-mongodb-app's People

Contributors

kinngh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

shopify-node-express-mongodb-app's Issues

cross-env and internal/erros:464 ErrorCaptureStackTrace(err)

Hi

I installed cross-env due to meet 'NODE_ENV' not found error

And did 'npm run dev' but meet this error

> node:internal/errors:464
>     ErrorCaptureStackTrace(err);
>     ^
> 
> Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './dist/auth/session/session.js' is not defined by "exports" in D:\shop-mongo\node_modules\@shopify\shopify-api\package.json imported from D:\shop-mongo\utils\sessionStorage.js
>     at new NodeError (node:internal/errors:371:5)
>     at throwExportsNotFound (node:internal/modules/esm/resolve:453:9)
>     at packageExportsResolve (node:internal/modules/esm/resolve:731:3)
>     at packageResolve (node:internal/modules/esm/resolve:913:14)
>     at moduleResolve (node:internal/modules/esm/resolve:978:18)
>     at defaultResolve (node:internal/modules/esm/resolve:1080:11)
>     at ESMLoader.resolve (node:internal/modules/esm/loader:530:30)
>     at ESMLoader.getModuleJob (node:internal/modules/esm/loader:251:18)
>     at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:79:40)
>     at link (node:internal/modules/esm/module_job:78:36) {
>   code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
> }
> [nodemon] app crashed - waiting for file changes before starting...

How to resolve it?

Thank you

There’s no page at this address when installing the app via Shopify Partners

Hello,

Thank you so much for your effort to build this repository.

I am new in shopify app developement, i am trying to learn & understand how shopify app works.

I want to fix a problem but i don't know how to fix it. When i try to install the app via url : https://ngrockurl/auth?shop=${shop}, it works & redirect to the installation page shopify (below screenshot)
image

But when i try to install the app using the shopify partner, i have this error 'There’s no page at this address' (below screenshot)
image

I launch the application test in a test store using the shopify partners dashboard like this (below screenshot)
image

It's like they try to launch the '/' (Index component of react) but the app is not installed yet in the store, and there no redirection to /auth or something like that.
Can you help me with a hint to fix it please ?

Thank you so much

npm run update:url issue

Hey Harshdeep I'm getting this error when trying to run update:url:

api as cliAPI,
^^^
SyntaxError: The requested module '@shopify/cli-kit' does not provide an export named 'api'
at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

any idea what could cause this?

Working with theme extension, Giving 404 error while fetching data from database to theme extension.

First of all thanks for the package, first time i am working with your package. Recently, i created an extension, now i am trying to send the product id along with shop name. And wants to retrieve the data from database and set in local storage.

I have created the route for getting the data, but it's returning 404 not found. I am not getting the issue. As other admin routes working fine but when i am trying to access the get-frontend-product on storefront. it throw error 404

Error:- https://prnt.sc/ufd8NYe-sATV

Here is my theme extension code

  $.ajax({
                method: "POST",
                url: `https://d16d-2405-201-5003-ae2d-785e-446b-9992-c22d.in.ngrok.io/api/get-frontend-product`,
                cache: false,
                headers: {
                    "Content-Type": "application/json",
                  },
                data: { shop: shopUrl, productId:product_id},
                success: function (response) {
                    local_set('vdata',response);
                    console.log(response,'response..............');
                }
            })

Routes

userRoutes.post("/api/get-frontend-product", async (req, res) => {
  let frontProduct = await getFrontendProduct(req,res);
  if (frontProduct) {
    res.status(200).send({frontProduct,success:true});
  } else {
    res.status(403).send("An error occured");
  }
});

KIndly help me out, why it's not working, other api route working fine for admin side. But i am trying to work with theme app extension to work with store. Help would be appreciated.

Thanks

Not able to install the application

Hey @kinngh

This boilerplate and detailed video on youtube is the gold for a new shopify app developer like me.

Following up on the instruction, I have done the setup

Now, when I am trying to install the app on my store, the install button is getting disabled

image

I am not sure, whether something need to be done as part of the setup or some settings on my store

Recent i update the code as per lasted code. getting Error for session not load.

@kinngh Thank for the up to date this code boilerplate.
i was facing some issue with old user who has app already app installed. for those store app was not loading.
i can see the this server side log as per beloved mention.
`

SessionStorageError: CustomSessionStorage failed to load a session. Error Details: Error: Unsupported state or unable to authenticate data
| at SessionStorageError.ShopifyError [as constructor] ( /node_modules/@shopify/shopify-api/dist/error.js:13:28)
| at new SessionStorageError ( /node_modules/@shopify/shopify-api/dist/error.js:206:42)
| at CustomSessionStorage. ( /node_modules/@shopify/shopify-api/dist/auth/session/storage/custom.js:51:31)
| at step ( /node_modules/tslib/tslib.js:144:27)
| at Object.throw ( /node_modules/tslib/tslib.js:125:57)
| at rejected ( /node_modules/tslib/tslib.js:116:69)
| at processTicksAndRejections (node:internal/process/task_queues:96:5

`

after force fully hit the /auth url app is working fine.

Dev mode is currently broken

The npm run dev is currently broken leading to a lot of 4xx and 5xx errors since the dev mode implementation is half baked. The production mode runs just fine with npm run build followed by a npm run start. HMR isn't supported in production mode, so any changes to React side of things need a npm run build and refresh in the embedded app to update.

npm run s:e:deploy | ERROR Invalid hook call

I'm getting this error in my console when running npm run s:e:deploy

ERROR Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React DOM) 2. You might be breaking the Rules of Hooks 3. You might have more than one copy of React in the same app See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.

This command has worked in the past and I haven't made any changes to my theme-app-extension so I'm not sure why it's throwing this error.

I've tried all these solutions https://bobbyhadz.com/blog/react-invalid-hook-call-hooks-can-only-be-called-inside-body

I'm also not using react in my theme-app-extension, so I'm not sure why this error occurred out of nowhere.

I've cloned this repo to test if it's an issue with my specific app but the same error occurred.

how to access offline Session or get from db

const session = await Shopify.Utils.loadCurrentSession(req, res, false); //offline token
const session = Shopify.Utils.loadCurrentSession(req, res, false);


but still here is getting Error on Req is underfunded 
i try with the

how to access offline session

   const session = new Shopify.Utils.loadOfflineSession("offline_"+args.shop);
    const client = new Shopify.Clients.Graphql(session.shop, session.accessToken);

Error Getting

on console 
{
  "message": "Missing access token when creating GraphQL client",
  
}


Server side Error 

@shopify/shopify-api/dist/auth/oauth/oauth.js:207
            var authHeader = request.headers.authorization;
                                             ^

TypeError: Cannot read properties of undefined (reading 'authorization')

Convert `CommonJS` to `Module`

  1. The idea has always been to stay up-to-date with as many standards as available.
  2. Client side code uses module style anyways, so converting server side to module would simplify reading and writing code

Deplyoment error

Error: ENOENT: no such file or directory, open '/app/frontend/dist/index.html'
at Object.openSync (node:fs:590:3)
at readFileSync (node:fs:458:35)
at file:///app/server/index.js:182:15
at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)
at trim_prefix (/app/node_modules/express/lib/router/index.js:328:13)
at /app/node_modules/express/lib/router/index.js:286:9
at param (/app/node_modules/express/lib/router/index.js:365:14)
at param (/app/node_modules/express/lib/router/index.js:376:14)
at Function.process_params (/app/node_modules/express/lib/router/index.js:421:3)
at next (/app/node_modules/express/lib/router/index.js:280:10)
at SendStream.error (/app/node_modules/serve-static/index.js:121:7)
at SendStream.emit (node:events:513:28)
at SendStream.error (/app/node_modules/send/index.js:270:17)
at SendStream.onStatError (/app/node_modules/send/index.js:417:12)
at onstat (/app/node_modules/send/index.js:722:26)
at FSReqCallback.oncomplete (node:fs:202:21)

Hi,
I m getting this error after the deployment, can you please help to fix it?
Thank You!

authenticated Shopify Api request from theme-app-extension

My app creates Discounts for users after they verify ownership of a specific NFT. I'm using the Proxy route correctly and am able to retrieve necessary data from MongoDB to verify ownership but my /create-discount-code-auth Route throws an error.

I guess I need a hand understanding how to make authenticated Shopify API calls from Shopify's theme-app-extension.

App proxy route

proxyRouter.get("/create-discount-code-auth", verifyRequest(proxyRouter), async (req, res) => {
  const session = await Shopify.Utils.loadCurrentSession(req, res, true);
  const { PriceRule } = await import(
    `@shopify/shopify-api/dist/rest-resources/${Shopify.Context.API_VERSION}/index.js`
  );

  const { DiscountCode } = await import(
    `@shopify/shopify-api/dist/rest-resources/${Shopify.Context.API_VERSION}/index.js`
  );

  const discount_code = Math.random().toString(36).slice(2, 24).toUpperCase();
  const rule_id = req.query.rule_id;
  const validity = req.query.validity;

  const start = new Date();
  const end = moment(start).add(Number(validity), "minutes").format();

  const price_rule = new PriceRule({ session });
  price_rule.id = rule_id;
  price_rule.starts_at = start;
  price_rule.ends_at = end;
  await price_rule.save({});

  const discount = new DiscountCode({ session });
  discount.price_rule_id = rule_id;
  discount.code = discount_code;

  try {
    await discount.save({});
    req.body = { message: `Discount code created [  ${discount_code}  ]` };
    res.status(200).json(req.body);
  } catch (error) {
    req.body = {
      message: `Discount code creation failed with error ${error.message}`,
    };
  }
});

Call from theme-app-extension

const createDiscountCode = async (rule_id, selected_discount_validity) => {
    const response = await Axios.get(`/apps/discount-express-proxy/create-discount-code-auth? 
    validity=${selected_discount_validity}&rule_id=${rule_id}`).then((response) => response.data);
    alert(response.message);
};

createDiscountCode(setSelectedRule, "15");

This Route works from inside my app but I am looking to trigger it on the storefront.

Screenshot 2022-10-06 151916

I'm posting here as I'm using your boilerplate and am hoping I've just missed a step.

Thanks.

Getting a 404 error

I followed your instructions. When I try to install the app from the Partners dashboard it redirects me to a 404 page.

Issue retrieving offline access token

In order to get an offline access token for graphqlqueries in a webhook do I need to extend the auth middleware with another callback function that stores an offline token? I cannot see any integrated method to access it otherwise...

[shopify-api/ERROR] Invalid OAuth callback.

Hey Harshdeep hope you are fine,
I am getting this error

"--->Error at /auth/tokens InvalidOAuthError: Invalid OAuth callback."

This error occurs when I try to install the app on two stores of same account at same time. When I click on install button of first store then second store simultaneously. This error comes on one of them as the other store successfully install the app. Also some times this error accours while installing on one single store also.

I am working on first shopify project to learn shopify app development.
I want to fix this. Do you have any idea what could cause this error?

How to work with graphql using webhook.

I am working with order create and order update webhook. I wanted to add the tags to the order but i am not able to do it. Kindly let me know how to work with Graphql in webhook.

Query:- How can i pass the req, res in clientProvider.graphqlClient using webhook file. (orders_create.js)

Here is the code , what i am trying to do.

import clientProvider from "../../utils/clientProvider.js";

Code

//  graphql operations
   const { client } = await clientProvider.graphqlClient({
     req,
     res,
     isOnline: false,
   });

   const response =  await client.query({
     data: `mutation tagsAdd {
       tagsAdd(id: "gid://shopify/Order/${orderId}", tags: "Preorder") {
         node {
           id
         }
         userErrors {
           field
           message
         }
       }
     }
     `,
   });

Empty`database.sqlite` file being created

A random database.sqlite file building up in the server directory with the following heads in the table:

id, shop, state, isOnline, scope, accessToken

This is seen after updating the @shopify/shopify-api package to 3.1.0

Polaris 9.22 doesn't seem to support React 18

I get this error when trying to install a package (after following SETUP.md and everything working fine originally):
npm ERR! Conflicting peer dependency: [email protected] npm ERR! node_modules/react npm ERR! peer react@"^16.14.0 || ^17.0.0" from @shopify/[email protected] npm ERR! node_modules/@shopify/polaris npm ERR! @shopify/polaris@"^9.22.0" from the root project

Any ideas here? Not sure why it allowed me to do everything during initial setup but is now complaining.

It seems to be causing issues with any npm installation moving forward (but the app itself doesn't break, just npm complains)

Really great repo otherwise, thanks so much!

404 in admin/app after install

I'm having trouble getting the app to run in the admin dashboard. After I click install to my shop from the partner dashboard, it redirects me to "https://myngroksercer.io/?hmac=&shop=.myshopify.com&timestamp=1659089273". The full screen loads at this address before it redirects me to "https://.myshopify.com/admin/apps/<SHOPIFY_API_KEY>/?hmac=&shop=.myshopify.com&timestamp=1659089273", and from here I get a "There’s no page at this address".

Has anyone had this issue?

OAuth flow does not work in dev / production

Hey there,

First of all, thanks a lot for this code starter !

I experience some issue in dev and production concerning the redirection for the OAuth.

  • In development, I can see in the console the [shopify-api/DEBUG] OAuth started, redirecting to .... notice, but no redirect is happening. And in the chrome console Refused to frame 'https://test-dev.myshopify.com/' because an ancestor violates the following Content Security Policy directive: "frame-ancestors 'none'".

  • In production I have the following error in the chrome console:

Refused to display 'https://test-app-staging.myshopify.com/' in a frame because it set 'X-Frame-Options' to 'deny'. like the redirection is made on the backend side instead of the frontend.

Can you help me with that ?

Thanks a lot

`hookrouter` navigation issue

APP::ERROR::INVALID_CONFIG: host must be provided error when using navigate() to navigate around the application.

Package JSON Start Script

Hi There,

Thanks for the hard work on this one. I'm about to deploy a private app live and found the start script didn't work unless I altered the script to

"start": "NODE_ENV=production node server/index.js",

Trying to query Rest client throws unauthorized error

I am trying to get a product from the store like this:

const client = new shopify.clients.Rest({ session });
const product = await client.get({
     path: `products/${productId}`,
     query: {id: 1, title: "title"}
});

But it is throwing the following error:

code: 401,
[server]     statusText: 'Unauthorized',
[server]     body: {
[server]       errors: '[API] Invalid API key or access token (unrecognized login or wrong password)'
[server]     },

I am retrieving the session from the mongodb to pass to this function. It is succesfully creating the client. But fails to access the endpoints with the created client. What am I missing here?

npm run s:e:create - ERROR Invalid hook call. Hooks can only be called inside of the body of a function component

Hello,

Is anyone having an issue with npm run s:e:create?

I encountered the following error:
image

I can build and run the project with no problem, but when I try to run the command: npm run s:e:create to create a theme app extension in the project I got the error above.

I am using the latest project with the latest dependencies.

  • I am on a Windows machine and have set up local MongoDB using the local folder method
  • Shopify is working and I can see the store with my app
  • I have not made any modification other than following the "setup steps" to get things started

I am fairly new to Shopify App development, any help will be greatly appreciated. Thanks in advance!

Vite HTTP proxy error

Hi! I've been following through your tutorial on YouTube to get a feel for how everything works, but am running into an issue hosting the server. I've followed all the steps through to 40:53 on the video, but when I try adding the app to my dev shop I'm running into a 500 internal server error. My steps to start it are as follows:

Start mongo (mongod --dpbath mongo)
Run ngrok, copy ngrok.io link to SHOPIFY_APP_URL
Run npm run update:url
Verify url's are updated in Shopify partner page
Run npm run dev

When I go to localhost:4040 it displays each attempt as GET /auth | 500 Internal Server Error | <time>, and in the npm run dev console each attempt displays the message:
[vite] http proxy error at /auth?shop=<shop name>.myshopify.com: [client] Error: connect ECONNREFUSED 127.0.0.1:8081 [client] at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1487:16)

Any help would be much appreciated!

APP::ERROR::INVALID_CONFIG: host must be provided

Hello I am new to Shopify development. I set up the repo and made no changes besides the necessary variables in .env. The app loads initially, but hitting Subscriptions or Recurring buttons causes this error.

Thanks for your help.

Screen Shot 2022-05-19 at 10 47 29 AM

App production mode crashed

Error after app reinstalling

**The app couldn’t be loaded

This app can’t load due to an issue with browser cookies. Try enabling cookies in your browser, switching to another browser, or contacting the developer to get support.**

i run node app after npm run build still the error. can you help me on that

hmac timestamp is outside of the tolerance range

After successfully app installation. It display blank white screen with following message.
hmac timestamp is outside of the tolerance range
image

### Second Issue

After running this command :- npm run update:url

Note:- I do have already installed the node modules

[email protected] update:url
node devUtils/updateDashboard.js

node:internal/errors:490
ErrorCaptureStackTrace(err);
^

Error [ERR_MODULE_NOT_FOUND]: Cannot find module 'E:\Shopify app\order\node_modules@shopify\cli-kit\dist\index.js' imported from E:\Shopify app\order\devUtils\updateDashboard.js
at new NodeError (node:internal/errors:399:5)
at finalizeResolution (node:internal/modules/esm/resolve:326:11)
at moduleResolve (node:internal/modules/esm/resolve:945:10)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap. (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36) {
code: 'ERR_MODULE_NOT_FOUND'
}

System :- Windows 10
Node version:- v18.14.1

Cannot Get / while running "shopify app serve"

First of all, Thank you for this amazing project.

I am using Shopify CLI to run this app. Everything is working fine. Installs properly, but doesn't work after app finishes installing. Stucks at Cannot Get / . Here's an image that supports the claim.
image

The problem is there is no Vite middleware that gets attached to the express on the index route (as app gets redirected to home page after installation is finished)
I tried working on that but no luck.
Can you fix this issue or find a way to get a roundabout?
Here's the vite config file.

const viteConfig = defineConfig({
    define: {
        "process.env.SHOPIFY_API_KEY": process.env.SHOPIFY_API_KEY,
        appOrigin: process.env.HOST.replace(/https:\/\//, "")
    },
    plugins: [react()],
    build: {
        outDir: "../dist/client/",
    },
    root: dirname(fileURLToPath(import.meta.url)),
    resolve: {
        preserveSymlinks: true,
    },
    server: {
        host: "localhost",
        port: VitePort,
        hmr: hmrConfig,
        proxy: {
            // Routes are kept separate on purpose
            "^/auth(/|(\\?.*)?$)": proxyOptions,
            "^/apps(/|(\\?.*)?$)": proxyOptions,
            "^/proxy_route(/|(\\?.*)?$)": proxyOptions,
            "^/graphql(/|(\\?.*)?$)": proxyOptions,
            "^/webhooks(/|(\\?.*)?$)": proxyOptions,
            "^/gdpr(/|(\\?.*)?$)": proxyOptions,
        },
    },
});

P.S: I am not entirely following setup.md as you suggested, but I am sure I have added the necessary configuration. I am using shopify app serve command

CSP rejected by shopify team.

App rejected notice.
App must set security headers to protect against clickjacking.
To prevent clickjacking attacks, your app must set the proper content security policy directive. If your app is not embedded in an Iframe in the Shopify admin, and you are seeing this message, check your app's settings and make sure it is set to "non-embedded." If your app is embedded, then we expect the 'Content-Security-Policy' header to be frame-ancestors https://admin.shopify.com/ https://[shop].myshopify.com, where [shop] is dynamically set to the shop domain the app is embedded on.

my app code with repo 93fbd7a

i can see the CSP new update . 3e4bedb

old code has same CSP header value.

app CSP network tab set into the header.
git csp 2

root url /* not working on install

When you install on a test shop from the Shopify Partner the root url "/" returns "There is nothing here".
The only way to install is by going directly to /auth?shop=xyz

Shouldn't the Test Shop functionality work?
My understanding is that when published the installation process will try to go the root URL and find nothing.

If I enter /auth as the App URL on Shopify Partner, then the process will start looping.

devUtils -> updateDashboard.mjs URl stop Working

` [email protected] update:url

node devUtils/updateDashboard.mjs

--> This is for use in DEV mode only
--> Fetching Access Tokens
--> Fetching Orgs
--> Fetching App Data
--> Updating URLs
node:internal/process/promises:279
triggerUncaughtException(err, true /* fromPromise */);
^

Error: Variable $applicationUrl of type Url! was provided invalid value: {"response":{"errors":[{"message":"Variable $applicationUrl of type Url! was provided invalid value","locations":[{"line":2,"column":40}],"extensions":{"value":null,"problems":[{"path":[],"explanation":"Expected value to not be null"}]}},{"message":"Variable $redirectUrlWhitelist of type [Url]! was provided invalid value","locations":[{"line":2,"column":63}],"extensions":{"value":null,"problems":[{"path":[],"explanation":"Expected value to not be null"}]}}],"status":200,"headers":{}},"request":{"query":"\n mutation appUpdate($apiKey: String!, $applicationUrl: Url!, $redirectUrlWhitelist: [Url]!) {\n appUpdate(input: {apiKey: $apiKey, applicationUrl: $applicationUrl, redirectUrlWhitelist: $redirectUrlWhitelist}) {\n userErrors {\n message\n field\n }\n }\n }\n","variables":{"apiKey":"dbfa3d88cf635407319677513f4bea5e","appUrl":"https://a29c-180-211-99-158.ngrok.io","redir":["https://a29c-180-211-99-158.ngrok.io/auth/tokens","https://a29c-180-211-99-158.ngrok.io/auth/callback"]}}}
`

HMR support for Firefox / Vite

Vite's HMR fails on Firefox and requires a restart instead. The switch to wss is required for HMR to work as intended.

Temp solution: Use Chrome.

Note: This is not being worked on actively until I'm clear on the docs. I haven't had the time to go through this specific issue and copy/pasting solutions from other repos has not worked out yet.

Feature Request

based on user plan access on react side and theme app extension.

app not loading due to app.post("/graphql", verifyRequest

i am getting error

app was ruining perfectly but few store can't access the app pages

app is working fine there is no any change code based or package version - some case from store or may be shopify

code was still this repo up to date

6919b8f

@shopify/shopify-api": "^5.2.0",
Here is app log
data: { appInstallation: null }, errors: [ { message: 'access denied', locations: [Array], path: [Array] } ], extensions: { cost: { requestedQueryCost: 14, actualQueryCost: 2, throttleStatus: [Object] } } } InvalidJwtError: Failed to parse session token 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpxxxxxxxxx1wvdHJ5LXNob3AtZm9yLXRlc3QubXlzaG9waWZ5LmNvbVwvYWRtaW4iLCJkZXN0IjoiaHR0cHM6XC9xxxxxxxxxxx5c2hvcGlmeS5jb20iLCJhdWQiOiI4ODgwM2U5MDdmZDM5MmEzZTlmNzJmNDBmYzJlMTRhYyIsInN1YiI6IjgxMDUwNjk3OTMzIiwiZXhwIjoxNjczODY2MDYwLCJuYmYiOjE2NzM4NjYwMDAsImlhdCI6MTY3Mzg2NjAwMCwianRpIjoiYzY3NzY2YmUtMTljMy00ZjM3LxxxxxxxxxxxxxxTZkNTRmMGQyIiwic2lkIjoiMGU2MzhlYTc2N2RlMDFiYTJkMDA4M2FhNmFjZDJlMmYwMDFkZTEzNDY5NzUxYzYyZTFkZTM5M2IyZWMzZTVkYiJ9.srz83D65MJZajDYSg-vnms5xxxxxxxkIQo-j5arrKn0': jwt expired at InvalidJwtError.ShopifyError [as constructor] (appcode/node_modules/@shopify/shopify-api/dist/error.js:13:28) at new InvalidJwtError (appcode/node_modules/@shopify/shopify-api/dist/error.js:47:42) at decodeSessionToken (appcode/node_modules/@shopify/shopify-api/dist/utils/decode-session-token.js:23:15) at Object.getCurrentSessionId (appcode/node_modules/@shopify/shopify-api/dist/auth/oauth/oauth.js:174:69) at Object.<anonymous> (appcode/node_modules/@shopify/shopify-api/dist/utils/load-current-session.js:19:46) at step (appcode/node_modules/tslib/tslib.js:144:27) at Object.next (appcode/node_modules/tslib/tslib.j

 today i am access  app  successfully with my store and one client  store.
 Network call Success call store 

app gql working Screenshot

 one store i found the app page not loading due to the graphQL call fails 
Network call  fails store  call

Screenshot from 2023-01-16 18-05-14 gql fail

Test case

  • fails user app installed more then one week
  • tested app with fresh new install new store not any error it's working fine.
  • for the session token update i force enter the /auth it was successfully db updated but still getting same error

Getting blank screen after clicking install

I have server side subscription on home page once homepage is loaded.
In production I'm getting blank screen after clicking on install and following error message, it is still on SHOPIFY_APP_URL domain.

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/html". Strict MIME type checking is enforced for module scripts per HTML spec.

The app is installed, after going through admin>apps>My App it works fine

Trouble with API calls - most certainly user error.

Hey mate,

First of all, thanks so much for this template and for all the work you've put in. I've got it mostly up and running on my machine. I'd say you can certainly preemptively mark this issue as 'user error' haha.

Basically, I'm just having trouble with my API calls. I apologize for reaching out, but I've been trying for a good few days and just cannot work it out!

Are you able to take a look at my screenshots below and let me know if I'm missing something obvious?

My env
image

My index.js
image

My getData.js
image

My console response:
image

and finally, my terminal response from my npm run dev (this all runs fine until the request happens).
image

Also, goes without saying, but if you can't be bothered looking at all this, just tell me to piss off and mark this as resolved haha! You've done enough just making the template.

Model.findOneAndUpdate is not a function - Once again user error

Hey mate,

Thanks so much for your help a few days ago, and I'm sorry for pestering you again (last time I promise). Feel free to just ignore me and mark this as solved if you can't be bothered responding haha.

Basically, I'm trying to add some content to MongoDB.

I can see that your inbuild models are connecting up with no issues:
image

I created a new model, based of your original ones:
image

Then I run it as per your models as well (using findOneAndUpdate)
image

But, for some reason I get the following error:
image

Do you have any tips or tricks? I'm imagining there is something simple I'm missing here!

App Installation Issue

Hi, I am trying to install the app with shopify store. I have setup everything as mentioned but when I try to install app it shows "You don't have this app installed

Get shopifie-analytics and try again." again and again and not initilize the installation.

Please can you have a review on this issue as soon as possibe ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.