Questions tagged [swc]
An Adobe SWC file is a package of precompiled Flash symbols and ActionScript code that allows a Flash or Flex developer to distribute classes and assets, or to avoid recompiling symbols and code that will not change. Please, do not use this tag for questions related to the SWC JavaScript compiler (use [swc-compiler] instead).
116
questions with no upvoted or accepted answers
10
votes
2
answers
14k
views
"next/font" requires SWC although Babel is being used due to a custom babel config being present
Im facing this error when I try to run my Nextjs project using styled components.
This is my .babelrc
{
"plugins": [
[
"babel-plugin-styled-components",
{
...
6
votes
2
answers
833
views
Live Preview on a Flex (compc) generated SWC
Does anyone know what criterea Flash uses for discovering the Live Preview class for a Component?
Background
We are attempting to automate the creation of a SWC that contains a component to be used ...
4
votes
2
answers
1k
views
Turborepo internal package WITHOUT Next.js
I'm trying to create an internal package in a turborepo project. The shared package follows the same setup as the example, and it works as is in the Vite frontend project. However, when importing that ...
4
votes
0
answers
642
views
Module transpilation within a Next.js project with SWC
I have a project in Next.js and Typescript where I am trying to ensure code splitting and tree shaking works well for our purposes. I recently upgraded to Next.js 13.x and migrated from Babel to SWC.
...
3
votes
0
answers
459
views
Make Next.js 13 application run in old browser like Chrome 33
I need to create a Next.js application which uses Next 14+ that runs on a Chrome 33 browser which is supposed to support ES5 only. Given that some packages inside Next dependency like (@next/font) ...
3
votes
0
answers
233
views
Expression expected in index.js after switching to swc-loader
i have to change loader in my webpack.config to swc-loader and i'm using react-app-rewired, i have added the following code to config-overrides.js :
module.exports = function override(config, env) {
...
3
votes
0
answers
914
views
SWC is not adding extension on imports
I'm working with SWC compiler for the first time in a project. I'm using it to compile my typescript files in /src to javascript files in /dist.
The structure of the project is something like this:
| -...
3
votes
0
answers
475
views
Next.js 13 + Styled Components "Warning: Prop className did not match." error - how to migrate from babel to SWC?
When upgrading the Next version from 12 to 13 I got the error "Warning: Prop className did not match." pointing to styled-components. My initial setup was with babel, including babel-plugin-...
3
votes
0
answers
3k
views
SWC configuration of Node 18 with typescript with esm
Okay,so I have a problem with node. SWC builds everything correctly and I can run the app - great. The problem starts when I try to use "top-level await" feature. I just can't get it to work ...
3
votes
1
answer
2k
views
How can I resolve ESM / require error using TS 4.8?
I use Node.js application and TS 4.8, and I updated package file-type, but now my project compilation fails with error
[1] const _fileType = /#PURE/ _interopRequireWildcard(require("file-type&...
3
votes
1
answer
2k
views
Migrating NextJS@11 to NextJS@12 with SWC config
I'm trying to migrate my NextJS App to version 12.
it's working properly using babel config, but I like to change the environment to swc.
I have the error below during production build:
./src/pages/...
2
votes
0
answers
184
views
building nestjs app with SWC inside an nx-based monorepo does not bundle /libs source code but references imports instead?
I'm trying to find out how to configure SWC in a way that builds the applications inside my monorepo with the source code from my libs directory, like I used to do with webpack (although much much ...
2
votes
0
answers
323
views
Why is Next.js trying to load @next/swc-linux-arm64-gnu despite .babelrc being present?
I am getting the error logs when trying to load a page in dev environment:
2024-03-11 17:17:06 yarn run v1.22.19
2024-03-11 17:17:06 $ next dev -p 4000
2024-03-11 17:17:10 Disabled SWC as ...
2
votes
0
answers
2k
views
@swc/jest and typescript does not allow jest to run tests
I'm using react, typescript and SWC to compile my project,
also using @swc/jest as transformer in my jest config like below:
module.exports = {
...some config
transform: {
'^.+\\.(t|j)sx?$': ...
2
votes
0
answers
1k
views
How to properly configure swc-loader with webpack, when switching from ts-loader for better build performance
I have a ts-loader configuration in webpack,
test: /\.tsx?$/,
use: [
{
loader: 'ts-loader',
options: {
transpileOnly: true
}
}
]
This was taking like 5 mins of build time.
so, ...