Shopify / shopify-app-js

MIT License
249 stars 96 forks source link

[shopify-app-express]: After adding logger configuration exception is occured. #497

Open BartKoKr opened 9 months ago

BartKoKr commented 9 months ago

Issue summary

D:\source\repos\shopifyApplication\node_modules\@shopify\shopify-app-express\build\cjs\middlewares\ensure-installed-on-shop.js:16
    config.logger.info('Running ensureInstalledOnShop');
                    ^
TypeError: config.logger.info is not a function
    at D:\source\repos\shopifyApplication\node_modules\@shopify\shopify-app-express\build\cjs\middlewares\ensure-installed-on-shop.js:16

Expected behavior

Logger works properly.

Actual behavior

Error occurs.

Steps to reproduce the problem

  1. Add logger configuration into shopify.js:
    import { shopifyApp } from "@shopify/shopify-app-express";
    ....
    const shopify = shopifyApp({
    ....
    logger: {
        level: LogSeverity.Info,
        timestamps: true,
        httpRequests: false,
    },
    });
  2. Run application.
  3. Exception occurs.
lizkenyon commented 9 months ago

Hi there 👋

Thanks for reaching out and flagging this! I was able to reproduce this and it is an issue.

A current workaround seems to be if you don't specify the logger in the ShopifyApp, the info level logs work as expected.

github-actions[bot] commented 7 months ago

This issue is stale because it has been open for 90 days with no activity. It will be closed if no further action occurs in 14 days.

github-actions[bot] commented 4 months ago

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.