Skip to content

Vite v8 incompatibility with use-sync-external-store/shim CJS #651

Description

@codeart1st

After upgrading to vite v8, there is a problem inside @legendapp/state.

Uncaught SyntaxError: The requested module '/@fs/path/node_modules/use-sync-external-store/shim/index.js?v=20286631' does not provide an export named 'useSyncExternalStore' (at react.mjs:3:10)
import { isFunction, isEmpty, observable, computeSelector, isArray, isMap, isObservableValueReady, isPromise, getNode as getNode$1, linked, observe, when, whenReady, internal, trackSelector, isPrimitive, isObservable } from '@legendapp/state';
import React, { memo, forwardRef, createElement, useState, useContext, useMemo, useRef, useEffect, createContext, useCallback } from 'react';
import { useSyncExternalStore } from 'use-sync-external-store/shim/index.js'; // <--- vite v8 can't handle this
import { enableReactive } from '@legendapp/state/react-reactive/enableReactive';

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions