Skip to content

Commit 0f3ad28

Browse files
skvejosepot
authored andcommitted
Fix compile error on Next.js 12 (Directory import)
We're using `react-rxjs` but have transitioned away to an SSR framework, however Node doesn't seem to support this syntax of importing from a directory without specifically writing `index.js`. Installing `react-rxjs` on a freshly setup Next.js project yields the following error when trying to import `bind` from `@react-rxjs/core`: ``` Error: Directory import '*<project>*/node_modules/use-sync-external-store/shim' is not supported resolving ES modules imported from *<project>*/node_modules/@react-rxjs/core/dist/core.es2019.mjs Did you mean to import use-sync-external-store/shim/index.js? ```
1 parent 5a37acd commit 0f3ad28

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/core/src/internal/useObservable.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Subscription } from "rxjs"
2-
import { useSyncExternalStore } from "use-sync-external-store/shim"
2+
import { useSyncExternalStore } from "use-sync-external-store/shim/index.js"
33
import { useRef, useState } from "react"
44
import { SUSPENSE, filterOutSuspense } from "../SUSPENSE"
55
import { DefaultedStateObservable, StateObservable } from "@josepot/rxjs-state"

0 commit comments

Comments
 (0)