diff --git a/packages/next-swc/crates/next-core/src/next_import_map.rs b/packages/next-swc/crates/next-core/src/next_import_map.rs index 87ef801b78415..93572d8a68a90 100644 --- a/packages/next-swc/crates/next-core/src/next_import_map.rs +++ b/packages/next-swc/crates/next-core/src/next_import_map.rs @@ -661,6 +661,12 @@ pub async fn insert_next_shared_aliases( import_map.insert_singleton_alias("react", project_path); import_map.insert_singleton_alias("react-dom", project_path); + //https://github.com/vercel/next.js/blob/f94d4f93e4802f951063cfa3351dd5a2325724b3/packages/next/src/build/webpack-config.ts#L1196 + import_map.insert_exact_alias( + "setimmediate", + request_to_import_mapping(project_path, "next/dist/compiled/setimmediate"), + ); + insert_turbopack_dev_alias(import_map); insert_package_alias( import_map, diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/app/app/client.tsx b/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/app/app/client.tsx deleted file mode 100644 index 749f91bbf2ffd..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/app/app/client.tsx +++ /dev/null @@ -1,9 +0,0 @@ -'use client' - -export default function Component() { - return ( -
- {Buffer.from('Hello Client Component', 'utf-8').toString()} -
- ) -} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/app/app/page.tsx b/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/app/app/page.tsx deleted file mode 100644 index 64b66b231eb5e..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/app/app/page.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import Component from './client' - -export default function Page() { - return ( -
- {Buffer.from('Hello Server Component', 'utf-8').toString()} - -
- ) -} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/app/layout.tsx b/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/app/layout.tsx deleted file mode 100644 index 12c84680889be..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/app/layout.tsx +++ /dev/null @@ -1,7 +0,0 @@ -export default function RootLayout({ children }: { children: any }) { - return ( - - {children} - - ) -} diff --git a/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/pages/index.tsx b/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/pages/index.tsx deleted file mode 100644 index 7a12e89221ac3..0000000000000 --- a/packages/next-swc/crates/next-dev-tests/tests/integration/next/polyfill/basic/input/pages/index.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { useRef } from 'react' -import { Harness, useTestHarness } from '@turbo/pack-test-harness' - -export default function Page() { - const pageIframeRef = useRef(null) - const appIframeRef = useRef(null) - - useTestHarness((mod) => - runTests(mod, pageIframeRef.current!, appIframeRef.current) - ) - - return ( - <> -