S
SolidJS10mo ago
Glitch

Error running Jest - testing

I'm working on a Solid.js libary, it uses internally a dependency called @wagmi/core but I'm getting this error
C:\Users\Glitch\Desktop\wagmi\solid-no-bun\node_modules\.pnpm\@[email protected][email protected][email protected][email protected]\node_modules\@wagmi\core\dist\esm\exports\index.js:4
export { call } from '../actions/call.js';
^^^^^^

SyntaxError: Unexpected token 'export'

> 1 | import { BaseError as CoreError } from '@wagmi/core'
| ^
2 |
3 | import { getVersion } from '../utils/getVersion.js'
4 |

at Runtime.createScriptFromCode (../node_modules/.pnpm/[email protected]/node_modules/jest-runtime/build/index.js:1505:14)
at Object.require (src/errors/base.ts:1:1)
at Object.require (src/errors/base.test.ts:1:1)
C:\Users\Glitch\Desktop\wagmi\solid-no-bun\node_modules\.pnpm\@[email protected][email protected][email protected][email protected]\node_modules\@wagmi\core\dist\esm\exports\index.js:4
export { call } from '../actions/call.js';
^^^^^^

SyntaxError: Unexpected token 'export'

> 1 | import { BaseError as CoreError } from '@wagmi/core'
| ^
2 |
3 | import { getVersion } from '../utils/getVersion.js'
4 |

at Runtime.createScriptFromCode (../node_modules/.pnpm/[email protected]/node_modules/jest-runtime/build/index.js:1505:14)
at Object.require (src/errors/base.ts:1:1)
at Object.require (src/errors/base.test.ts:1:1)
Any idea how to fix it?
2 Replies
Glitch
GlitchOP10mo ago
switched to vitest*
Alex Lohr
Alex Lohr10mo ago
I have once written a lengthy diatribe on how to configure jest to accept solid, but really, I should have written "switch to vitest".
Want results from more Discord servers?
Add your server