blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

TS Incompatible with typescript-estree #377

Closed Vandivier closed 2 years ago

Vandivier commented 2 years ago

What is the problem?

  1. Checking out this commit, which I think is equivalent to 0.44 release, yarn && yarn test fails out of the box without modification
  2. I get errors which are described below, including one that says WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.
  3. note that I'm on windows

Paste all your error logs here:

$ yarn test
yarn run v1.22.10
$ yarn run lint && yarn run build && ultra -r test
$ eslint --ext ".js,.ts,.tsx" .
=============

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <4.4.0

YOUR TYPESCRIPT VERSION: 4.5.2

Please only submit bug reports when using the officially supported version.

=============

D:\workspace\github\blitz\test\jest-environment.js
  1:0  error  Parsing error: D:\workspace\github\blitz\test\jest-environment.js: Unexpected token (1:0)

> 1 | ../nextjs/test/jest-environment.js
    | ^

D:\workspace\github\blitz\test\jest-global-setup.js
  1:0  error  Parsing error: D:\workspace\github\blitz\test\jest-global-setup.js: Unexpected token (1:0)

> 1 | ../nextjs/test/jest-global-setup.js
    | ^

D:\workspace\github\blitz\test\jest-global-teardown.js
  1:0  error  Parsing error: D:\workspace\github\blitz\test\jest-global-teardown.js: Unexpected token (1:0)

> 1 | ../nextjs/test/jest-global-teardown.js
    | ^

D:\workspace\github\blitz\test\lib\next-webdriver.d.ts
  1:0  error  Parsing error: Declaration or statement expected

D:\workspace\github\blitz\test\lib\next-webdriver.js
  1:0  error  Parsing error: D:\workspace\github\blitz\test\lib\next-webdriver.js: Unexpected token (1:0)

> 1 | ../../nextjs/test/lib/next-webdriver.js
    | ^

✖ 5 problems (5 errors, 0 warnings)

error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Paste all relevant code snippets here:

n/a

What are detailed steps to reproduce this?

  1. fork repo and set blitz upstream in git. Checkout canary on fork.
  2. git fetch upstream canary && git reset --hard upstream/canary && yarn && yarn test

Run blitz -v and paste the output here:

$ blitz -v
Error: Cannot find module '@blitzjs/config'
Require stack:
- D:\workspace\github\blitz\packages\cli\lib\src\index.js
- C:\Users\John Vandivier\AppData\Local\Yarn\Data\global\node_modules\blitz\cli\dist\blitz-cli.cjs.dev.js
- C:\Users\John Vandivier\AppData\Local\Yarn\Data\global\node_modules\blitz\cli\dist\blitz-cli.cjs.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:941:15)
    at Module._load (node:internal/modules/cjs/loader:774:27)
    at Function._load (D:\workspace\github\blitz\node_modules\@salesforce\lazy-require\lib\LazyLoader.js:99:24)
    at Module.require (node:internal/modules/cjs/loader:1013:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (D:\workspace\github\blitz\packages\cli\lib\src\index.js:8:18)
    at Module._compile (node:internal/modules/cjs/loader:1109:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
    at Module.load (node:internal/modules/cjs/loader:989:32)
    at Function.Module._load (node:internal/modules/cjs/loader:829:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'D:\\workspace\\github\\blitz\\packages\\cli\\lib\\src\\index.js',
    'C:\\Users\\John Vandivier\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\blitz\\cli\\dist\\blitz-cli.cjs.dev.js',
    'C:\\Users\\John Vandivier\\AppData\\Local\\Yarn\\Data\\global\\node_modules\\blitz\\cli\\dist\\blitz-cli.cjs.js'
  ]
}

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

No response

flybayer commented 2 years ago

Hmm, probably we need to update these deps: https://github.com/blitz-js/blitz/blob/canary/nextjs/packages/eslint-config-next/package.json#L14-L15

If you are using yarn, you can use the package.json resolutions field to overside those versions to a newer one.