blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

Vercel boilerplate type error resulting in broken build #33

Open JonasBa opened 3 years ago

JonasBa commented 3 years ago

What is the problem?

Tried creating a project through vercel's GUI using Blitz template and deploying it resulted in compile time type error

Paste all your error logs here:

09:53:34.254    Cloning github.com/JonasBa/.... (Branch: master, Commit: c3e825a)
09:53:34.972    Cloning completed in 718ms
09:53:34.974    Analyzing source code...
09:53:35.420    Installing build runtime...
09:53:37.435    Build runtime installed: 2015.550ms
09:53:39.136    Looking up build cache...
09:53:39.211    Build cache not found
09:53:40.028    Installing dependencies...
09:53:40.435    yarn install v1.22.10
09:53:40.467    info No lockfile found.
09:53:40.472    [1/4] Resolving packages...
09:53:43.023    warning blitz > eslint-config-blitz > babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
09:53:44.447    warning blitz > jest-environment-jsdom-fourteen > jsdom > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
09:53:44.451    warning blitz > jest-environment-jsdom-fourteen > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
09:53:45.126    warning blitz > jest-environment-jsdom-fourteen > @jest/environment > @jest/transform > jest-haste-map > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
09:53:45.470    warning blitz > jest-environment-jsdom-fourteen > jsdom > request > har-validator@5.1.5: this library is no longer supported
09:53:45.551    warning blitz > jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
09:53:45.551    warning blitz > jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
09:53:45.873    warning blitz > @blitzjs/installer > jscodeshift > micromatch > snapdragon > source-map-resolve > resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
09:53:45.875    warning blitz > @blitzjs/installer > jscodeshift > micromatch > snapdragon > source-map-resolve > urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
09:53:46.628    warning babel-eslint@10.1.0: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
09:53:47.177    [2/4] Fetching packages...
09:54:06.482    info fsevents@2.3.2: The platform "linux" is incompatible with this module.
09:54:06.483    info "fsevents@2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
09:54:06.483    info fsevents@1.2.13: The platform "linux" is incompatible with this module.
09:54:06.483    info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
09:54:06.488    [3/4] Linking dependencies...
09:54:06.490    warning "blitz > @testing-library/react-hooks@4.0.1" has incorrect peer dependency "react@>=16.9.0".
09:54:06.491    warning "blitz > react-test-renderer@17.0.1" has incorrect peer dependency "react@17.0.1".
09:54:06.491    warning "blitz > @blitzjs/babel-preset > babel-plugin-superjson-next@0.2.2" has unmet peer dependency "next@>=9.0.0".
09:54:06.491    warning "blitz > @blitzjs/babel-preset > babel-plugin-superjson-next@0.2.2" has unmet peer dependency "superjson@1.x".
09:54:06.491    warning "blitz > @blitzjs/installer > jscodeshift@0.11.0" has unmet peer dependency "@babel/preset-env@^7.1.6".
09:54:06.492    warning "blitz > @blitzjs/installer > ink@3.0.8" has incorrect peer dependency "react@>=16.8.0".
09:54:06.492    warning "blitz > @blitzjs/installer > ink-spinner@4.0.1" has incorrect peer dependency "react@^16.8.2".
09:54:06.492    warning "blitz > @blitzjs/core > null-loader@4.0.1" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
09:54:06.492    warning "blitz > @blitzjs/core > react-query@2.5.12" has incorrect peer dependency "react@^16.8.0".
09:54:06.492    warning "blitz > @blitzjs/core > next@10.0.9" has incorrect peer dependency "react@^16.6.0 || ^17".
09:54:06.492    warning "blitz > @blitzjs/core > next@10.0.9" has incorrect peer dependency "react-dom@^16.6.0 || ^17".
09:54:06.493    warning "blitz > react-test-renderer > react-shallow-renderer@16.14.1" has incorrect peer dependency "react@^16.0.0 || ^17.0.0".
09:54:06.493    warning "blitz > eslint-config-blitz > eslint-config-react-app@6.0.0" has incorrect peer dependency "eslint@^7.5.0".
09:54:06.494    warning "blitz > eslint-config-blitz > eslint-plugin-flowtype@5.2.2" has incorrect peer dependency "eslint@^7.1.0".
09:54:06.495    warning "blitz > @blitzjs/installer > ink > react-reconciler@0.24.0" has incorrect peer dependency "react@^16.0.0".
09:54:06.495    warning "blitz > @blitzjs/core > next > @next/react-dev-overlay@10.0.9" has incorrect peer dependency "react@^16.9.0 || ^17".
09:54:06.495    warning "blitz > @blitzjs/core > next > @next/react-dev-overlay@10.0.9" has incorrect peer dependency "react-dom@^16.9.0 || ^17".
09:54:06.496    warning "blitz > @blitzjs/core > next > styled-jsx@3.3.2" has incorrect peer dependency "react@15.x.x || 16.x.x || 17.x.x".
09:54:06.496    warning "blitz > @blitzjs/core > next > use-subscription@1.5.1" has incorrect peer dependency "react@^16.8.0 || ^17.0.0".
09:54:06.498    warning " > eslint-config-react-app@5.2.1" has incorrect peer dependency "eslint-plugin-react-hooks@1.x || 2.x".
09:54:19.681    [4/4] Building fresh packages...
09:54:26.408    success Saved lockfile.
09:54:26.411    $ prisma generate || true
09:54:26.834    prisma:warn @prisma/cli has been renamed to prisma.
09:54:26.834    Please uninstall @prisma/cli: yarn remove @prisma/cli
09:54:26.835    And install prisma: yarn add --dev prisma
09:54:27.891    Error: Could not find a schema.prisma file that is required for this command.
09:54:27.891    You can either provide it with --schema, set it as `prisma.schema` in your package.json or put it into the default location ./prisma/schema.prisma https://pris.ly/d/prisma-schema-location
09:54:27.899    Done in 47.47s.
09:54:27.955    Detected Next.js version: 10.0.9
09:54:27.959    Running "yarn run build"
09:54:28.305    yarn run v1.22.10
09:54:28.339    $ blitz build
09:54:28.480    You are using beta software - if you have any problems, please open an issue here:
09:54:28.481          https://github.com/blitz-js/blitz/issues/new/choose
09:54:29.717    - Compiling
09:54:33.666    ✔ Compiled
09:54:34.806    warn  - You have enabled experimental feature(s).
09:54:34.807    warn  - Experimental features are not covered by semver, and may cause unexpected or broken application behavior. Use them at your own risk.
09:54:34.807    info  - Creating an optimized production build...
09:54:34.821    Attention: Next.js now collects completely anonymous telemetry regarding usage.
09:54:34.821    This information is used to shape Next.js' roadmap and prioritize features.
09:54:34.822    You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:
09:54:34.822    https://nextjs.org/telemetry
09:54:38.086    Failed to compile.
09:54:38.086    
09:54:38.086    ../../node_modules/@blitzjs/core/dist/declarations/src/server/auth/sessions.d.ts:8:28
09:54:38.086    Type error: ',' expected.
09:54:38.086       6 |     ({ ctx, args }: {
09:54:38.086       7 |         ctx: any;
09:54:38.086    >  8 |         args: [roleOrRoles?: RoleType | RoleType[]];
09:54:38.087         |                            ^
09:54:38.087       9 |     }): boolean;
09:54:38.087      10 | }
09:54:38.087      11 | export declare const simpleRolesIsAuthorized: SimpleRolesIsAuthorized;
09:54:38.145    error Command failed with exit code 1.
09:54:38.145    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
09:54:38.161    Error: Command "yarn run build" exited with 1
09:54:40.902    Done with "package.json"

Looks like highlighting breaks stack trace formatting on Github - here is a screenshot of the trace

CleanShot 2021-03-21 at 10 23 27@2x

Paste all relevant code snippets here:

None

What are detailed steps to reproduce this?

  1. Create new vercel project from blitz template
  2. Try deploying the projecct

Run blitz -v and paste the output here:

macOS Big Sur | darwin-x64 | Node: v12.18.2

blitz: 0.33.0 (global) blitz: 0.33.0 (local)

Package manager: yarn System: OS: macOS 11.3 CPU: (12) x64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz Memory: 683.97 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 12.18.2 - ~/.nvm/versions/node/v12.18.2/bin/node Yarn: 1.22.4 - /usr/local/bin/yarn npm: 6.14.6 - ~/.nvm/versions/node/v12.18.2/bin/npm Watchman: Not Found npmPackages: @prisma/client: ~2.17 => 2.17.0 blitz: 0.33.0 => 0.33.0 prisma: ~2.17 => 2.17.0 react: 0.0.0-experimental-3310209d0 => 0.0.0-experimental-3310209d0 react-dom: 0.0.0-experimental-3310209d0 => 0.0.0-experimental-3310209d0 typescript: ~4.1 => 4.1.5

flybayer commented 3 years ago

@JonasBa does blitz build work locally? (always the first thing to try if production build fails)

Also please paste the contents of your tsconfig.json

styfle commented 3 years ago

I see the same TS error with latest blitz version. Steps to reproduce:

git clone https://github.com/uncurated-tests/blitzjs-2021-03
cd blitzjs-2021-03
yarn install
yarn build
flybayer commented 3 years ago

Ok yes the solution to this problem is we need to update the vercel example: https://github.com/vercel/vercel/tree/master/examples/blitzjs

The workaround is create a new app via blitz new

satya-nutella commented 3 years ago

@flybayer is this still open? It seems like this was merged. Should we close this?

flybayer commented 2 years ago

@meehawk their template still needs updated. It's currently at v0.17 lol