For question about SWC (Speedy Web Compiler), a Rust-based JavaScript compiler.
Questions tagged [swc-compiler]
70 questions
0
votes
0 answers
Is there a way to omit a package or library from being minified or ignored by SWC?
So I am building an audio chatroom in Next.js. For the chatting and calling features, I am using Agora that makes use of the agora-rtm-sdk agora-rtm-sdk and agora-rtc-sdk-ng agora-rtc packages.
So when building locally, everything works well.
The…

Tim Mwaura
- 577
- 1
- 7
- 24
0
votes
0 answers
SWC typescript is not affect fast reload
I'm trying to improve nodemon server/start speed.
my script command in package.json is
installed npm install --save-dev ts-node @swc/core @swc/helpers regenerator-runtime
scripts: {
"dev": "nodemon --watch src server.ts"
}
and…

ram
- 11
- 4
0
votes
0 answers
trouble with WebAssembly from swc and vite
My application tries to load swc with a dynamic import:
const swcWasmWeb = await import("@swc/wasm-web");
await swcWasmWeb.default();
this works fine, if the WASM-file is copied manually to
..\node_modules\.vite\deps
How can i configure vite to…

ahorak
- 123
- 8
0
votes
0 answers
I want to extend React-Query support on old browsers without manually testing my Next application on the said old browsers
I found this quote on the installation page but I don't understand the approach they want me to take:
"Depending on your environment, you might need to add polyfills. If you want to support older browsers, you need to transpile the library from…

Yash Sonalia
- 378
- 2
- 8
0
votes
1 answer
Unhandled Runtime Error Error: [object ProgressEvent] with next JS/typescript
I'm new to nextJS and typescript. I'm trying to create simple blog with nextJS/typescript and sanity CMS backend. When I run dev, it successfully compiles but then I get the following Unhandled Runtime Error Error.
OS: MacOS monterey(M1)
Node:…

JwillH
- 1
0
votes
1 answer
NextJS, SWC, React18, ReferenceError: React is not defined
I updated my Nextjs website to React18 and wanted to switch to SWC compiler. I am having a hard time wrapping my head around how to get this to work. I didn't have a custom babelrc config before. Whatever I do I keep getting
Error occurred…

Nikola-Milovic
- 1,393
- 1
- 12
- 35
0
votes
0 answers
Is there a difference in output if I use 'swc minify' when build the nextJS?
When I saw the internal files of the .next folder, I didn't feel any difference, but I wonder if there is any difference internally

zabe
- 1
- 2
0
votes
1 answer
Using SWC with Bazel
I'm trying to compile my TS files to JS with SWC in Bazel. I'm unfortunately unable to use the rules_js library (which has rules_swc), so I need to hand roll it. So far I have:
load("@npm//@swc/cli:index.bzl", "swc")
SRC_FILES =…
0
votes
0 answers
Next.js already loading SWC binary but still with error on VS Code editor
Just start my first Next.js project and immediately faced the common issue "Failed to load SWC binary for darwin/x64".
After following the recommended steps:
Remove node_modules and package-lock.json;
Run npm install;
It starts to run, but I keep…

João Mendonça
- 13
- 6
0
votes
1 answer
Developing Next.js with SWC minify in Docker with bind mount and Yarn 3: missing swc-linux-x64-gnu linux binary
I am developing with Next.js on my Mac OS host using Docker running Ubuntu 18 and bind mounting my development directory to the container. I want to know if there is any way when using SWC Minify in Next.js 12+ to not have to copy over the whole…

Sean
- 629
- 8
- 24