Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

internal error: entered unreachable code: static_blocks pass should remove this #8960

Closed
hahazexia opened this issue May 18, 2024 · 1 comment
Assignees
Labels
Milestone

Comments

@hahazexia
Copy link

Describe the bug

use "next": "^14.3.0-canary.61" with forceSwcTransforms: true, then compile failed.

thread '' panicked at /Users/geist/.cargo/registry/src/index.crates.io-6f17d22bba15001f/swc_ecma_compat_es2022-0.4.17/src/class_properties/mod.rs:953:21:
internal error: entered unreachable code: static_blocks pass should remove this
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Failed to compile.

./src/pages/home/util.ts
Error: failed to process

Import trace for requested module:
./src/pages/home/util.ts
./src/pages/home/index.page.tsx

Input code

No response

Config

const nextConfig = {
  pageExtensions: ['page.tsx'],
  reactStrictMode: true,
  experimental: {
    forceSwcTransforms: true,
  }
};

export default nextConfig;

Playground link (or link to the minimal reproduction)

https://github.com/hahazexia/nextjs-swc-demo

SWC Info output

Operating System:
Platform: darwin
Arch: arm64
Machine Type: arm64
Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030
CPU: (12 cores)
Models: Apple M3 Pro

Binaries:
    Node: 18.17.0
    npm: 9.6.7
    Yarn: 1.22.22
    pnpm: 8.15.5

Relevant Packages:
    @swc/core: N/A
    @swc/helpers: 0.5.11
    @swc/types: N/A
    typescript: 5.4.5
    next: 14.3.0-canary.61

SWC Config:
    output: N/A
    .swcrc path: N/A

Next.js info:
    output: N/A

Expected behavior

I expect the compilation and packaging to be successful

Actual behavior

No response

Version

next: 14.3.0-canary.61

Additional context

No response

@kdy1 kdy1 self-assigned this May 18, 2024
@kdy1 kdy1 added this to the Planned milestone May 18, 2024
@kdy1
Copy link
Member

kdy1 commented May 20, 2024

I can't reproduce with a latest canary.
https://github.com/kdy1/repro-swc-8960

╭─ ~/projects/repro-swc-8960 main ························································································································································································· 10s 20:26:23 ─╮
❯ pnpm build

> nextjs-swc-demo@0.1.0 build /Users/kdy1/projects/repro-swc-8960
> next build

  ▲ Next.js 14.3.0-canary.70
  - Experiments (use with caution):
    · forceSwcTransforms

 ✓ Linting and checking validity of types
   Creating an optimized production build ...
 ✓ Compiled successfully
 ✓ Collecting page data
 ✓ Generating static pages (3/3)
 ✓ Collecting build traces
 ✓ Finalizing page optimization

Route (pages)                             Size     First Load JS
┌ ○ /404                                  189 B          89.6 kB
└ ○ /home                                 526 B          89.9 kB
+ First Load JS shared by all             89.4 kB
  ├ chunks/framework-160824e3e44ba547.js  56.3 kB
  ├ chunks/main-f52c176a5468d549.js       32.1 kB
  └ other shared chunks (total)           941 B

○  (Static)  prerendered as static content

@kdy1 kdy1 closed this as completed May 20, 2024
@kdy1 kdy1 modified the milestones: Planned, v1.5.9 May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants