Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Importing @shopify/koa-shopfy-auth crashes the server with no error message #67

Closed
2 tasks done
Twiggeh opened this issue Mar 12, 2021 · 1 comment
Closed
2 tasks done

Comments

@Twiggeh
Copy link

Twiggeh commented Mar 12, 2021

Issue summary

Importing

import createShopifyAuth, { verifyRequest } from '@shopify/koa-shopify-auth';

throws this in tsc, and the server crashes

node_modules/@shopify/koa-shopify-auth/dist/src/verify-request/types.d.ts(1,28): error TS2307: Cannot find module 'src/types' or its corresponding type declarations.

image

Expected behavior

Shouldn't crash :D

Actual behavior

Crahses

Simple Fix:

import createShopifyAuth from '@shopify/koa-shopify-auth';

const { verifyRequest } = createShopifyAuth; 

import ShopifyMaster, { ApiVersion } from '@shopify/shopify-api';

const Shopify = ShopifyMaster.default;

Steps to reproduce the problem

  1. git clone https://github.com/Twiggeh/koa-shopify-auth-report.git
  2. cd koa-shopify-auth-report/server && yarn install && yarn debug
    (Seperate Terminal)
  3. cd koa-shopify-auth-report/server && node ./dist/app.js

Checklist

  • Please delete the labels section before submitting your issue
  • I have described this issue in a way that is actionable (if possible)
@paulomarg
Copy link
Contributor

Hey @Twiggeh, thanks for this! It was a broken import in the verify-request/types.ts file that caused this. It was fixed in #63!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants