Skip to content

Fix object not extensible - #5835

Merged
Murderlon merged 4 commits into
mainfrom
fix-object-not-extensible
Jul 21, 2025
Merged

Fix object not extensible#5835
Murderlon merged 4 commits into
mainfrom
fix-object-not-extensible

Conversation

@Murderlon

Copy link
Copy Markdown
Contributor

Closes #5829

@Murderlon
Murderlon requested review from mifi and qxprakash July 21, 2025 09:59
@Murderlon Murderlon self-assigned this Jul 21, 2025
@github-actions

Copy link
Copy Markdown
Contributor
Diff output files
diff --git a/packages/@uppy/audio/lib/PermissionsScreen.d.ts b/packages/@uppy/audio/lib/PermissionsScreen.d.ts
index d6c5dd1..9b26aab 100644
--- a/packages/@uppy/audio/lib/PermissionsScreen.d.ts
+++ b/packages/@uppy/audio/lib/PermissionsScreen.d.ts
@@ -1,5 +1,5 @@
 import type { I18n } from '@uppy/utils/lib/Translator';
-import type { h } from 'preact';
+import { h } from 'preact';
 interface PermissionsScreenProps {
     icon: () => h.JSX.Element | null;
     hasAudio: boolean;
diff --git a/packages/@uppy/audio/lib/PermissionsScreen.js b/packages/@uppy/audio/lib/PermissionsScreen.js
index 968c6b6..3e76f56 100644
--- a/packages/@uppy/audio/lib/PermissionsScreen.js
+++ b/packages/@uppy/audio/lib/PermissionsScreen.js
@@ -1,3 +1,4 @@
+import { h } from "preact";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 export default (props) => {
   const { icon, hasAudio, i18n } = props;
diff --git a/packages/@uppy/dashboard/lib/Dashboard.d.ts b/packages/@uppy/dashboard/lib/Dashboard.d.ts
index 9155f35..088655b 100644
--- a/packages/@uppy/dashboard/lib/Dashboard.d.ts
+++ b/packages/@uppy/dashboard/lib/Dashboard.d.ts
@@ -4,6 +4,7 @@ import { defaultPickerIcon } from '@uppy/provider-views';
 import type StatusBarLocale from '@uppy/status-bar/lib/locale.js';
 import type { LocaleStrings } from '@uppy/utils/lib/Translator';
 import type { ComponentChild, VNode } from 'preact';
+import { h } from 'preact';
 import locale from './locale.js';
 type GenericEventCallback = () => void;
 export type DashboardFileEditStartCallback<M extends Meta, B extends Body> = (file?: UppyFile<M, B>) => void;
@@ -225,7 +226,7 @@ export default class Dashboard<M extends Meta, B extends Body> extends UIPlugin<
     private superFocusOnEachUpdate;
     readonly afterUpdate: () => void;
     saveFileCard: (meta: M, fileID: string) => void;
-    render: (state: State<M, B>) => import("preact").JSX.Element;
+    render: (state: State<M, B>) => h.JSX.Element;
     setOptions(opts: Partial<DashboardOptions<M, B>>): void;
     install: () => void;
     uninstall: () => void;
diff --git a/packages/@uppy/dashboard/lib/Dashboard.js b/packages/@uppy/dashboard/lib/Dashboard.js
index b8e71f7..e08640e 100644
--- a/packages/@uppy/dashboard/lib/Dashboard.js
+++ b/packages/@uppy/dashboard/lib/Dashboard.js
@@ -7,6 +7,7 @@ import findAllDOMElements from "@uppy/utils/lib/findAllDOMElements";
 import getDroppedFiles from "@uppy/utils/lib/getDroppedFiles";
 import toArray from "@uppy/utils/lib/toArray";
 import { nanoid } from "nanoid/non-secure";
+import { h } from "preact";
 import packageJson from "../package.json" with { type: "json" };
 import DashboardUI from "./components/Dashboard.js";
 import locale from "./locale.js";
diff --git a/packages/@uppy/dashboard/lib/components/Slide.js b/packages/@uppy/dashboard/lib/components/Slide.js
index 1dc995d..058e7f7 100644
--- a/packages/@uppy/dashboard/lib/components/Slide.js
+++ b/packages/@uppy/dashboard/lib/components/Slide.js
@@ -1,5 +1,5 @@
 import classNames from "classnames";
-import { cloneElement, toChildArray } from "preact";
+import { cloneElement, h, toChildArray } from "preact";
 import { useEffect, useRef, useState } from "preact/hooks";
 const transitionName = "uppy-transition-slideDownUp";
 const duration = 250;
diff --git a/packages/@uppy/provider-views/lib/Breadcrumbs.d.ts b/packages/@uppy/provider-views/lib/Breadcrumbs.d.ts
index 70e3f26..030bcb9 100644
--- a/packages/@uppy/provider-views/lib/Breadcrumbs.d.ts
+++ b/packages/@uppy/provider-views/lib/Breadcrumbs.d.ts
@@ -1,5 +1,5 @@
 import type { Body, Meta, PartialTreeFolder } from '@uppy/core';
-import { type h } from 'preact';
+import { h } from 'preact';
 import type ProviderView from './ProviderView/index.js';
 type BreadcrumbsProps<M extends Meta, B extends Body> = {
     openFolder: ProviderView<M, B>['openFolder'];
diff --git a/packages/@uppy/provider-views/lib/Breadcrumbs.js b/packages/@uppy/provider-views/lib/Breadcrumbs.js
index d579669..c6013aa 100644
--- a/packages/@uppy/provider-views/lib/Breadcrumbs.js
+++ b/packages/@uppy/provider-views/lib/Breadcrumbs.js
@@ -1,4 +1,4 @@
-import { Fragment } from "preact";
+import { Fragment, h } from "preact";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 export default function Breadcrumbs(props) {
   const { openFolder, title, breadcrumbsIcon, breadcrumbs, i18n } = props;
diff --git a/packages/@uppy/provider-views/lib/Item/components/GridItem.d.ts b/packages/@uppy/provider-views/lib/Item/components/GridItem.d.ts
index 1123a5d..a7e3fc5 100644
--- a/packages/@uppy/provider-views/lib/Item/components/GridItem.d.ts
+++ b/packages/@uppy/provider-views/lib/Item/components/GridItem.d.ts
@@ -1,5 +1,5 @@
 import type { PartialTreeFile, PartialTreeFolderNode } from '@uppy/core';
-import type { h } from 'preact';
+import { h } from 'preact';
 type GridItemProps = {
     file: PartialTreeFile | PartialTreeFolderNode;
     toggleCheckbox: (event: Event) => void;
diff --git a/packages/@uppy/provider-views/lib/Item/components/GridItem.js b/packages/@uppy/provider-views/lib/Item/components/GridItem.js
index 2a0d528..12e207f 100644
--- a/packages/@uppy/provider-views/lib/Item/components/GridItem.js
+++ b/packages/@uppy/provider-views/lib/Item/components/GridItem.js
@@ -1,3 +1,4 @@
+import { h } from "preact";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 import ItemIcon from "./ItemIcon.js";
 function GridItem(
diff --git a/packages/@uppy/provider-views/lib/Item/components/ItemIcon.d.ts b/packages/@uppy/provider-views/lib/Item/components/ItemIcon.d.ts
index b758a01..04931f5 100644
--- a/packages/@uppy/provider-views/lib/Item/components/ItemIcon.d.ts
+++ b/packages/@uppy/provider-views/lib/Item/components/ItemIcon.d.ts
@@ -1,4 +1,4 @@
-import type { h } from 'preact';
+import { h } from 'preact';
 type ItemIconProps = {
     itemIconString: string;
     alt?: string;
diff --git a/packages/@uppy/provider-views/lib/Item/components/ItemIcon.js b/packages/@uppy/provider-views/lib/Item/components/ItemIcon.js
index 508889b..cb8fb3f 100644
--- a/packages/@uppy/provider-views/lib/Item/components/ItemIcon.js
+++ b/packages/@uppy/provider-views/lib/Item/components/ItemIcon.js
@@ -1,3 +1,4 @@
+import { h } from "preact";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 function FileIcon() {
   return (_jsx("svg", {
diff --git a/packages/@uppy/provider-views/lib/Item/components/ListItem.d.ts b/packages/@uppy/provider-views/lib/Item/components/ListItem.d.ts
index b1fe525..189fa8b 100644
--- a/packages/@uppy/provider-views/lib/Item/components/ListItem.d.ts
+++ b/packages/@uppy/provider-views/lib/Item/components/ListItem.d.ts
@@ -1,5 +1,5 @@
 import type { PartialTreeFile, PartialTreeFolderNode, PartialTreeId } from '@uppy/core';
-import type { h } from 'preact';
+import { h } from 'preact';
 type ListItemProps = {
     file: PartialTreeFile | PartialTreeFolderNode;
     openFolder: (folderId: PartialTreeId) => void;
diff --git a/packages/@uppy/provider-views/lib/Item/components/ListItem.js b/packages/@uppy/provider-views/lib/Item/components/ListItem.js
index ec3afc6..12d05f0 100644
--- a/packages/@uppy/provider-views/lib/Item/components/ListItem.js
+++ b/packages/@uppy/provider-views/lib/Item/components/ListItem.js
@@ -1,3 +1,4 @@
+import { h } from "preact";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 import ItemIcon from "./ItemIcon.js";
 export default function ListItem(
diff --git a/packages/@uppy/provider-views/lib/Item/index.d.ts b/packages/@uppy/provider-views/lib/Item/index.d.ts
index 346621f..8e3f475 100644
--- a/packages/@uppy/provider-views/lib/Item/index.d.ts
+++ b/packages/@uppy/provider-views/lib/Item/index.d.ts
@@ -1,6 +1,6 @@
 import type { PartialTreeFile, PartialTreeFolderNode, PartialTreeId } from '@uppy/core';
 import type { I18n } from '@uppy/utils/lib/Translator';
-import type { h } from 'preact';
+import { h } from 'preact';
 type ItemProps = {
     file: PartialTreeFile | PartialTreeFolderNode;
     openFolder: (folderId: PartialTreeId) => void;
diff --git a/packages/@uppy/provider-views/lib/Item/index.js b/packages/@uppy/provider-views/lib/Item/index.js
index 1058f55..b01d3cd 100644
--- a/packages/@uppy/provider-views/lib/Item/index.js
+++ b/packages/@uppy/provider-views/lib/Item/index.js
@@ -1,4 +1,5 @@
 import classNames from "classnames";
+import { h } from "preact";
 import { jsx as _jsx } from "preact/jsx-runtime";
 import GridItem from "./components/GridItem.js";
 import ListItem from "./components/ListItem.js";
diff --git a/packages/@uppy/provider-views/lib/ProviderView/AuthView.d.ts b/packages/@uppy/provider-views/lib/ProviderView/AuthView.d.ts
index e808430..312616a 100644
--- a/packages/@uppy/provider-views/lib/ProviderView/AuthView.d.ts
+++ b/packages/@uppy/provider-views/lib/ProviderView/AuthView.d.ts
@@ -1,6 +1,6 @@
 import type { Body, Meta } from '@uppy/core';
 import type { I18n } from '@uppy/utils/lib/Translator';
-import type { h } from 'preact';
+import { h } from 'preact';
 import type ProviderViews from './ProviderView.js';
 import type { Opts } from './ProviderView.js';
 type AuthViewProps<M extends Meta, B extends Body> = {
diff --git a/packages/@uppy/provider-views/lib/ProviderView/AuthView.js b/packages/@uppy/provider-views/lib/ProviderView/AuthView.js
index 0489e63..2b889c8 100644
--- a/packages/@uppy/provider-views/lib/ProviderView/AuthView.js
+++ b/packages/@uppy/provider-views/lib/ProviderView/AuthView.js
@@ -1,3 +1,4 @@
+import { h } from "preact";
 import { useCallback } from "preact/hooks";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 function GoogleIcon() {
diff --git a/packages/@uppy/provider-views/lib/ProviderView/Header.d.ts b/packages/@uppy/provider-views/lib/ProviderView/Header.d.ts
index ca03f74..f20cb04 100644
--- a/packages/@uppy/provider-views/lib/ProviderView/Header.d.ts
+++ b/packages/@uppy/provider-views/lib/ProviderView/Header.d.ts
@@ -1,6 +1,6 @@
 import type { Body, Meta, PartialTreeFolder } from '@uppy/core';
 import type { I18n } from '@uppy/utils/lib/Translator';
-import type { h } from 'preact';
+import { h } from 'preact';
 import type ProviderView from './ProviderView.js';
 type HeaderProps<M extends Meta, B extends Body> = {
     showBreadcrumbs: boolean;
diff --git a/packages/@uppy/provider-views/lib/ProviderView/Header.js b/packages/@uppy/provider-views/lib/ProviderView/Header.js
index f0815d8..f42638c 100644
--- a/packages/@uppy/provider-views/lib/ProviderView/Header.js
+++ b/packages/@uppy/provider-views/lib/ProviderView/Header.js
@@ -1,4 +1,5 @@
 import classNames from "classnames";
+import { h } from "preact";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 import Breadcrumbs from "../Breadcrumbs.js";
 import User from "./User.js";
diff --git a/packages/@uppy/provider-views/lib/ProviderView/ProviderView.d.ts b/packages/@uppy/provider-views/lib/ProviderView/ProviderView.d.ts
index 255f292..120bee9 100644
--- a/packages/@uppy/provider-views/lib/ProviderView/ProviderView.d.ts
+++ b/packages/@uppy/provider-views/lib/ProviderView/ProviderView.d.ts
@@ -1,7 +1,7 @@
 import type { Body, Meta, PartialTree, PartialTreeFile, PartialTreeFolder, PartialTreeFolderNode, UnknownProviderPlugin } from '@uppy/core';
 import type { CompanionFile } from '@uppy/utils/lib/CompanionFile';
 import type { I18n } from '@uppy/utils/lib/Translator';
-import type { h } from 'preact';
+import { h } from 'preact';
 export declare function defaultPickerIcon(): h.JSX.Element;
 type Optional<T, K extends keyof T> = Pick<Partial<T>, K> & Omit<T, K>;
 export interface Opts<M extends Meta, B extends Body> {
diff --git a/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js b/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js
index c7f994e..c74457e 100644
--- a/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js
+++ b/packages/@uppy/provider-views/lib/ProviderView/ProviderView.js
@@ -1,5 +1,6 @@
 import remoteFileObjToLocal from "@uppy/utils/lib/remoteFileObjToLocal";
 import classNames from "classnames";
+import { h } from "preact";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 // @ts-ignore We don't want TS to generate types for the package.json
 import packageJson from "../../package.json";
diff --git a/packages/@uppy/provider-views/lib/SearchProviderView/SearchProviderView.d.ts b/packages/@uppy/provider-views/lib/SearchProviderView/SearchProviderView.d.ts
index 114c9f4..69aba5a 100644
--- a/packages/@uppy/provider-views/lib/SearchProviderView/SearchProviderView.d.ts
+++ b/packages/@uppy/provider-views/lib/SearchProviderView/SearchProviderView.d.ts
@@ -1,6 +1,6 @@
 import type { Body, DefinePluginOpts, Meta, PartialTree, PartialTreeFile, PartialTreeFolderNode, UnknownSearchProviderPlugin } from '@uppy/core';
 import type { CompanionFile } from '@uppy/utils/lib/CompanionFile';
-import type { h } from 'preact';
+import { h } from 'preact';
 interface Opts<M extends Meta, B extends Body> {
     provider: UnknownSearchProviderPlugin<M, B>['provider'];
     viewType?: 'list' | 'grid' | 'unsplash';
diff --git a/packages/@uppy/provider-views/lib/SearchProviderView/SearchProviderView.js b/packages/@uppy/provider-views/lib/SearchProviderView/SearchProviderView.js
index a11e7b7..617a16c 100644
--- a/packages/@uppy/provider-views/lib/SearchProviderView/SearchProviderView.js
+++ b/packages/@uppy/provider-views/lib/SearchProviderView/SearchProviderView.js
@@ -1,5 +1,6 @@
 import remoteFileObjToLocal from "@uppy/utils/lib/remoteFileObjToLocal";
 import classNames from "classnames";
+import { h } from "preact";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 // @ts-ignore We don't want TS to generate types for the package.json
 import packageJson from "../../package.json";
diff --git a/packages/@uppy/screen-capture/lib/DiscardButton.d.ts b/packages/@uppy/screen-capture/lib/DiscardButton.d.ts
index 1fee54a..df0add1 100644
--- a/packages/@uppy/screen-capture/lib/DiscardButton.d.ts
+++ b/packages/@uppy/screen-capture/lib/DiscardButton.d.ts
@@ -1,5 +1,5 @@
 import type { I18n } from '@uppy/utils/lib/Translator';
-import type { h } from 'preact';
+import { h } from 'preact';
 interface DiscardButtonProps {
     onDiscard: () => void;
     i18n: I18n;
diff --git a/packages/@uppy/screen-capture/lib/DiscardButton.js b/packages/@uppy/screen-capture/lib/DiscardButton.js
index be48c62..def8037 100644
--- a/packages/@uppy/screen-capture/lib/DiscardButton.js
+++ b/packages/@uppy/screen-capture/lib/DiscardButton.js
@@ -1,3 +1,4 @@
+import { h } from "preact";
 import { jsx as _jsx, jsxs as _jsxs } from "preact/jsx-runtime";
 export default function DiscardButton({ onDiscard, i18n }) {
   return (_jsx("button", {
diff --git a/packages/@uppy/screen-capture/lib/RecordButton.d.ts b/packages/@uppy/screen-capture/lib/RecordButton.d.ts
index c4d67a8..266e12d 100644
--- a/packages/@uppy/screen-capture/lib/RecordButton.d.ts
+++ b/packages/@uppy/screen-capture/lib/RecordButton.d.ts
@@ -1,5 +1,5 @@
 import type { I18n } from '@uppy/utils/lib/Translator';
-import type { h } from 'preact';
+import { h } from 'preact';
 interface RecordButtonProps {
     recording: boolean | undefined;
     onStartRecording: () => void;
diff --git a/packages/@uppy/screen-capture/lib/RecordButton.js b/packages/@uppy/screen-capture/lib/RecordButton.js
index 576c34a..f45c77f 100644
--- a/packages/@uppy/screen-capture/lib/RecordButton.js
+++ b/packages/@uppy/screen-capture/lib/RecordButton.js
@@ -1,3 +1,4 @@
+import { h } from "preact";
 import { jsx as _jsx } from "preact/jsx-runtime";
 /**
  * Control screen capture recording. Will show record or stop button.
diff --git a/packages/@uppy/screen-capture/lib/SubmitButton.d.ts b/packages/@uppy/screen-capture/lib/SubmitButton.d.ts
index cff8ac9..0a46bb1 100644
--- a/packages/@uppy/screen-capture/lib/SubmitButton.d.ts
+++ b/packages/@uppy/screen-capture/lib/SubmitButton.d.ts
@@ -1,5 +1,5 @@
 import type { I18n } from '@uppy/utils/lib/Translator';
-import type { h } from 'preact';
+import { h } from 'preact';
 interface SubmitButtonProps {
     recording: boolean;
     recordedVideo: string | null;
diff --git a/packages/@uppy/screen-capture/lib/SubmitButton.js b/packages/@uppy/screen-capture/lib/SubmitButton.js
index d814a3d..9441600 100644
--- a/packages/@uppy/screen-capture/lib/SubmitButton.js
+++ b/packages/@uppy/screen-capture/lib/SubmitButton.js
@@ -1,3 +1,4 @@
+import { h } from "preact";
 import { jsx as _jsx } from "preact/jsx-runtime";
 /**
  * Submit recorded video to uppy. Enabled when file is available
diff --git a/packages/@uppy/status-bar/lib/StatusBar.js b/packages/@uppy/status-bar/lib/StatusBar.js
index e117849..09ebc62 100644
--- a/packages/@uppy/status-bar/lib/StatusBar.js
+++ b/packages/@uppy/status-bar/lib/StatusBar.js
@@ -1,6 +1,7 @@
 import { UIPlugin } from "@uppy/core";
 import emaFilter from "@uppy/utils/lib/emaFilter";
 import getTextDirection from "@uppy/utils/lib/getTextDirection";
+import { h } from "preact";
 import packageJson from "../package.json" with { type: "json" };
 import locale from "./locale.js";
 import statusBarStates from "./StatusBarStates.js";
diff --git a/packages/@uppy/webcam/lib/RecordingLength.d.ts b/packages/@uppy/webcam/lib/RecordingLength.d.ts
index 900161f..5c0b8a7 100644
--- a/packages/@uppy/webcam/lib/RecordingLength.d.ts
+++ b/packages/@uppy/webcam/lib/RecordingLength.d.ts
@@ -1,6 +1,7 @@
+import { h } from 'preact';
 interface RecordingLengthProps {
     recordingLengthSeconds: number;
 }
-export default function RecordingLength({ recordingLengthSeconds, }: RecordingLengthProps): import("preact").JSX.Element;
+export default function RecordingLength({ recordingLengthSeconds, }: RecordingLengthProps): h.JSX.Element;
 export {};
 //# sourceMappingURL=RecordingLength.d.ts.map
\ No newline at end of file
diff --git a/packages/@uppy/webcam/lib/RecordingLength.js b/packages/@uppy/webcam/lib/RecordingLength.js
index 40d1028..8f03763 100644
--- a/packages/@uppy/webcam/lib/RecordingLength.js
+++ b/packages/@uppy/webcam/lib/RecordingLength.js
@@ -1,3 +1,4 @@
+import { h } from "preact";
 import { jsx as _jsx } from "preact/jsx-runtime";
 import formatSeconds from "./formatSeconds.js";
 export default function RecordingLength({ recordingLengthSeconds }) {

@mifi mifi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

so jsxImportSource: 'preact' was the clue, nice!

@Murderlon
Murderlon merged commit 0294539 into main Jul 21, 2025
14 of 15 checks passed
@Murderlon
Murderlon deleted the fix-object-not-extensible branch July 21, 2025 10:48
Murderlon added a commit that referenced this pull request Jul 24, 2025
* main:
  Migrate to changesets from custom release tooling (#5840)
  Fix turbo race condition (#5839)
  Fix object not extensible (#5835)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

yarn dev error: Uncaught (in promise) TypeError: Cannot add property __, object is not extensible

2 participants