swc-compiler Questions

3

I'd like to not include .babelrc during build since SWC is disabled as a replacement for Babel. I only need .babelrc for a plugin for dev testing purposes that is not supported by SWC yet. I am tol...
Selfhood asked 21/3, 2022 at 21:1

31

Solved

When trying to run the command using nextjs npm run dev shows error - failed to load SWC binary see more info here: https://nextjs.org/docs/messages/failed-loading-swc. I've tried uninstalling node...
Dong asked 2/11, 2021 at 20:31

2

Solved

I have a typescript project which I'm transpiling with swc. I'm having trouble getting swc to resolve path aliases defined in either tsconfig.json or .swcrc. The module aliases are resolved properl...
Corkage asked 21/2, 2023 at 16:1

2

Solved

I've been struggling with transforming imports with Next.js using SWC complier. I'm trying to make use of swc-plugin-transform-import as a replacement of babel-plugin-transform-imports for shorting...
Paediatrics asked 26/9, 2022 at 17:37

0

I would like to use the modularizeImports option of the Next.js compiler on a library that its barrel file exports from multiple directories within the library package. What I mean is the index.ts ...
Bloomer asked 7/5, 2023 at 16:2

1

Solved

Next.JS uses babel to configure the Why Did You Render. module.exports = function (api) { const isServer = api.caller((caller) => caller?.isServer) const isCallerDevelopment = api.caller((call...
Adur asked 2/11, 2021 at 8:30

0

I am using swc to transpile my Typescript code on a side project and am struggling ignoring the tests files from the final output using the cli --ignore option. lib versions: @swc/cli: ^0.1.57 @s...
Glabrate asked 12/5, 2022 at 12:39

3

Solved

TL;DR How can you tell SWC to compile CSS files imported in React components? How can you tell SWC to compile absolute imports in tests and in React components? Here is a minimal reproducible exa...
Aleshia asked 28/1, 2022 at 19:58

3

Solved

When trying to run the command using Next.js npm run dev shows error - failed to load SWC binary see more info here: https://nextjs.org/docs/messages/failed-loading-swc. PS D:\web-development...
Arron asked 9/1, 2022 at 11:20

0

I'm using SWC for the first time and I'm not able to compile my ts files into normal js files. When I run my command : npx swc ./src -d dist I got the error : failed to process js file Caused by:...
Poland asked 6/2, 2022 at 14:49

1

Solved

I have a typescript file that import a json file like this: import DefaultMapping from "./default.json"; It compile with SWC like this in the js file: var _defaultJson = require("./...
Curious asked 26/1, 2022 at 15:41

1

Solved

I'm hoping to use SWC in Rust to generate some TypeScript code. Unfortunately, it seems the emitter can only print JavaScript. Is this correct, or is there a way to print TypeScript? For instance, ...

0

when trying to spin up a server using Jest, I keep getting the error: Cannot find module 'services/middleware'. In this case, services/middleware is located in src/services/middleware. I have set t...
Anglicanism asked 3/12, 2021 at 22:15

2

Solved

TL;DR How to translate a node script like this: "test": "NODE_ENV=test riteway -r @babel/register 'src/**/*.test.js' | tap-nirvana", to use SWC instead of Babel? Context We re...
Caskey asked 13/11, 2021 at 17:14
1

© 2022 - 2025 — McMap. All rights reserved.