stackblitz / bolt.new

Prompt, run, edit, and deploy full-stack web applications
https://bolt.new
MIT License
8.18k stars 3.06k forks source link

swc Error coming up #2824

Open HiteshG opened 2 days ago

HiteshG commented 2 days ago

Describe the bug

⚠ Attempted to load @next/swc-linux-x64-gnu, but an error occurred: Cannot load native addon because loading addons is disabled: /home/project/node_modules/@next/swc-linux-x64-gnu/next-swc.linux-x64-gnu.node ⚠ Attempted to load @next/swc-linux-x64-musl, but an error occurred: Cannot load native addon because loading addons is disabled: /home/project/node_modules/@next/swc-linux-x64-musl/next-swc.linux-x64-musl.node ⨯ Failed to load SWC binary for linux/x64, see more info here: https://nextjs.org/docs/messages/failed-loading-swc

It is not laoding

Link to the Bolt URL that caused the error

https://bolt.new/~/sb1-brraou

Steps to reproduce

  1. Open the link
  2. See the error

Expected behavior

Web app is not rendering as per requested. Tried multiple times.

Screen Recording / Screenshot

No

Platform

Browser name = Chrome
Full version = 130.0.0.0
Major version = 130
navigator.appName = Netscape
navigator.userAgent = Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
performance.memory = {
  "totalJSHeapSize": 210452515,
  "usedJSHeapSize": 204033947,
  "jsHeapSizeLimit": 2160066560
}
Username = HiteshG
Chat ID = d062d6fda92d

Additional context

No

mihir-kanzariya commented 2 days ago

I am facing same issue

mihir-kanzariya commented 2 days ago

@HiteshG Below guide resolve my issue

Step 1: Create a .babelrc File

Create a .babelrc file to configure Next.js to use Babel:

echo '{
  "presets": ["next/babel"]
}' > .babelrc

Step 2: Update next.config.js

Ensure that SWC minification is disabled by creating or updating your next.config.js file:

echo "module.exports = {
  swcMinify: false,
};" > next.config.js

Step 3: Install Required Dependencies

Install the necessary Babel runtime dependencies:

npm install @babel/runtime regenerator-runtime --save

Step 4: Clear Cache and Reinstall

Clear the cache and reinstall your dependencies to ensure a clean setup:

rm -rf .next && npm install --force

Step 5: Start the Development Server

Start your development server:

npm run dev