blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

[v0.44.0] Jest error #379

Closed JuanM04 closed 2 years ago

JuanM04 commented 2 years ago

What is the problem?

Errors are thrown when running yarn test after upgrading from v0.43.0 to v0.44.0

Paste all your error logs here:

node_modules/blitz/jest-preset/global-setup.js:2
import {loadEnvConfig} from "@blitzjs/env"
^^^^^^

SyntaxError: Cannot use import statement outside a module

Paste all relevant code snippets here:

What are detailed steps to reproduce this?

Import code which imports code from blitz into Jest

Run blitz -v and paste the output here:

Linux 5.15 | linux-x64 | Node: v16.13.0

blitz: 0.44.0 (local)

  Package manager: yarn 
  System:
    OS: Linux 5.15 Fedora Linux 35 (Workstation Edition)
    CPU: (12) x64 AMD Ryzen 5 3600XT 6-Core Processor
    Memory: 10.95 GB / 31.35 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.13.0 - ~/.volta/tools/image/node/16.13.0/bin/node
    Yarn: 3.1.1 - ~/.volta/tools/image/yarn/1.22.17/bin/yarn
    npm: 8.1.0 - ~/.volta/tools/image/node/16.13.0/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: ^3.6.0 => 3.6.0 
    blitz: ^0.44.0 => 0.44.0 
    prisma: ^3.6.0 => 3.6.0 
    react: ^17.0.2 => 17.0.2 
    react-dom: ^17.0.2 => 17.0.2 
    typescript: ~4.5.2 => 4.5.2 

Please include below any other applicable logs and screenshots that show your problem:

No response

aklassen commented 2 years ago

I experienced the same to today. Had to downgrade blitz to v0.43.0 to get the tests running on my new project.