From 607fe735693454c0785b7770a0fb83b3774d369f Mon Sep 17 00:00:00 2001 From: Lukasz Ostrowski Date: Tue, 22 Nov 2022 09:52:21 +0100 Subject: [PATCH] Update build config (#118) * Ensure peer deps are excluded * Release 0.20.1-0 * Change next router import to fix the build * Release 0.20.1-1 * Restore releaseit config --- package.json | 4 ++-- src/app-bridge/next/route-propagator.tsx | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 92abdcf..a1561d3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@saleor/app-sdk", - "version": "0.20.0", + "version": "0.20.1-1", "description": "SDK for building great Saleor Apps", "types": "index.d.ts", "main": "index.js", @@ -19,7 +19,7 @@ "author": "", "license": "ISC", "peerDependencies": { - "next": "^12", + "next": ">=12", "react": ">=17", "react-dom": ">=17" }, diff --git a/src/app-bridge/next/route-propagator.tsx b/src/app-bridge/next/route-propagator.tsx index b9555ff..af42aa7 100644 --- a/src/app-bridge/next/route-propagator.tsx +++ b/src/app-bridge/next/route-propagator.tsx @@ -1,4 +1,7 @@ -import { useRouter } from "next/router"; +/** + * Use .js extension to avoid broken builds with ESM + */ +import { useRouter } from "next/router.js"; import { useEffect } from "react"; import { actions } from "../actions";