Skip to content

Commit

Permalink
Fix/esm builds (#763)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasio authored May 7, 2024
1 parent a9ca72d commit 0682d9c
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .changeset/afraid-readers-laugh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@headstartwp/next": patch
---

Fix: add .js to import statement for next.js path imports
2 changes: 1 addition & 1 deletion packages/next/src/blocks/LinkBlock.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Link from 'next/link';
import Link from 'next/link.js';
import { removeSourceUrl } from '@headstartwp/core/utils';
import { IBlock, IBlockAttributes, useSettings } from '@headstartwp/core/react';
import { getAttributes, isAnchorTag } from '@headstartwp/core';
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/components/HeadlessApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from '@headstartwp/core/react';
import type { SettingsContextProps } from '@headstartwp/core/react';

import { useRouter } from 'next/router';
import { useRouter } from 'next/router.js';
import { getSiteByHost } from '@headstartwp/core';
import { Yoast } from './Yoast';
import { seoKey } from '../data/hooks/useSeo';
Expand Down
4 changes: 2 additions & 2 deletions packages/next/src/components/ImageComponent.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import NextImageComponent from 'next/image';
import type { ImageLoaderProps } from 'next/image';
import NextImageComponent from 'next/image.js';
import type { ImageLoaderProps } from 'next/image.js';
import { ImageBlockProps } from '@headstartwp/core/react';

// See error in https://github.com/vercel/next.js/issues/54777
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/components/Yoast.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
isElement,
} from '@headstartwp/core';
import { useSettings } from '@headstartwp/core/react';
import Head from 'next/head';
import Head from 'next/head.js';

export function convertUrl(url: string, hostUrl: string, sourceUrl: string) {
if (!url.startsWith(sourceUrl)) {
Expand Down
2 changes: 1 addition & 1 deletion packages/next/src/data/hooks/usePrepareFetch.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { EndpointParams, Entity, FetchResponse } from '@headstartwp/core';
import { FetchHookOptions, useSettings } from '@headstartwp/core/react';
import { useRouter } from 'next/router';
import { useRouter } from 'next/router.js';
import { convertToPath } from '../convertToPath';

/**
Expand Down

0 comments on commit 0682d9c

Please sign in to comment.