Folder import resulting in undefined

Having a tonne of trouble with trying to get swc working with jest as doing a folder import results in an empty object:
import * as x from '..';
import * as x from '..';
->
{__esModule: true}
{__esModule: true}
swcrc:
{
"$schema": "http://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"transform": {
"react": {
"runtime": "automatic"
}
},
"experimental": {
"plugins": [
[
"@swc/plugin-emotion",
{
"autoLabel": "always"
}
]
]
}
}
}
{
"$schema": "http://json.schemastore.org/swcrc",
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true
},
"transform": {
"react": {
"runtime": "automatic"
}
},
"experimental": {
"plugins": [
[
"@swc/plugin-emotion",
{
"autoLabel": "always"
}
]
]
}
}
}
tsconfig:
{
"compilerOptions": {
"target": "es2022",
"module": "esnext",
"composite": true,
"incremental": true,
"noEmit": true,
"pretty": true,
"sourceMap": true,

"lib": ["dom", "dom.iterable", "esnext"],

"strict": true,

"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "react-jsx",
"jsxImportSource": "@emotion/react",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"useDefineForClassFields": true
}
}
{
"compilerOptions": {
"target": "es2022",
"module": "esnext",
"composite": true,
"incremental": true,
"noEmit": true,
"pretty": true,
"sourceMap": true,

"lib": ["dom", "dom.iterable", "esnext"],

"strict": true,

"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"jsx": "react-jsx",
"jsxImportSource": "@emotion/react",
"moduleResolution": "node",
"noFallthroughCasesInSwitch": true,
"skipLibCheck": true,
"useDefineForClassFields": true
}
}
What am I doing wrong 🤔
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?