blitz-js / legacy-framework

MIT License
3 stars 2 forks source link

`blitz generate` broken on canary #316

Closed regardt-nel closed 3 years ago

regardt-nel commented 3 years ago

What is the problem?

Installed Blitz.js with recommended npm command but when I run blitz -v it shows that nothing is installed.

Paste all your error logs here:

Windows 10 | win32-x64 | Node: v12.13.0

blitz: 0.39.0 (global)

  Package manager: npm
  System:
    OS: Windows 10 10.0.19042
    CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor
    Memory: 3.10 GB / 7.95 GB
  Binaries:
    Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  npmPackages:
    @prisma/client: Not Found
    blitz: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: Not Found

Paste all relevant code snippets here:

npm install -g blitz

What are detailed steps to reproduce this?

Install Blitz with npm install -g blitz running Node 12.13

Run blitz -v and paste the output here:

PS C:\Users\regar> blitz -v
Windows 10 | win32-x64 | Node: v12.13.0

blitz: 0.39.0 (global)

  Package manager: npm
  System:
    OS: Windows 10 10.0.19042
    CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor
    Memory: 3.10 GB / 7.95 GB
  Binaries:
    Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  npmPackages:
    @prisma/client: Not Found
    blitz: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: Not Found

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

PS C:\Users\regar> npm i -g blitz npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details. npm WARN deprecated querystring@0.2.1: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead. npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated npm WARN deprecated sane@4.1.0: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added C:\Program Files\nodejs\blitz -> C:\Program Files\nodejs\node_modules\blitz\bin\blitz

blitz@0.39.0 postinstall C:\Program Files\nodejs\node_modules\blitz node scripts/postinstall.js

internal/modules/cjs/loader.js:797 throw err; ^

Error: Cannot find module 'react' Require stack:

sam3d commented 3 years ago

Do you only have Blitz installed globally? Not locally? (i.e. npm install blitz --save instead of npm install blitz --global)

regardt-nel commented 3 years ago

Hi @sam3d I only installed it globally as per the documentation. When I proceed to create a new Blitz project I get an error when I run the first migrate command - blitzjs/server not found. This lead me to check blitz -v to see if everything installed properly.

flybayer commented 3 years ago

@regardt-nel the "not found" from blitz -v is expected, those only show when running that command inside an app.

Did you try removing blitz and installing again? (could be a fluke)

The other thing you can try is npm i -g blitz@canary. Perhaps the issue is already fixed.

regardt-nel commented 3 years ago

HI @flybayer thanks for the suggestion. Installation ran perfectly. The app started up perfectly with blitz dev.

When I ran blitz generate all project name:string I got the following output ->

image

flybayer commented 3 years ago

@regardt-nel can you (1) paste the output of blitz -v and (2) paste the contents of node_modules/next/package.json?

regardt-nel commented 3 years ago

Package.json ->

PS C:\Projects\TodoToday> cat .\package.json
{
  "name": "TodoToday",
  "version": "1.0.0",
  "scripts": {
    "dev": "blitz dev",
    "build": "blitz build",
    "start": "blitz start",
    "studio": "blitz prisma studio",
    "lint": "eslint --ignore-path .gitignore --ext .js,.ts,.tsx .",
    "test": "jest",
    "test:watch": "jest --watch",
    "prepare": "husky install"
  },
  "prisma": {
    "schema": "db/schema.prisma"
  },
  "prettier": {
    "semi": false,
    "printWidth": 100
  },
  "lint-staged": {
    "*.{js,ts,tsx}": [
      "eslint --fix"
    ]
  },
  "dependencies": {
    "@prisma/client": "2.30.2",
    "blitz": "0.40.0-canary.7",
    "react-dom": "alpha",
    "react": "alpha",
    "zod": "3.8.1",
    "final-form": "4.20.2",
    "react-final-form": "6.5.3"
  },
  "devDependencies": {
    "@types/preview-email": "2.0.1",
    "@types/react": "17.0.19",
    "eslint": "7.32.0",
    "husky": "6.0.0",
    "lint-staged": "10.5.4",
    "prettier-plugin-prisma": "0.15.0",
    "prettier": "2.3.2",
    "pretty-quick": "3.1.1",
    "preview-email": "3.0.5",
    "prisma": "2.30.2",
    "typescript": "~4.3"
  },
  "private": true
}

blitz -v ->

PS C:\Projects\TodoToday> blitz -v
Windows 10 | win32-x64 | Node: v12.13.0

blitz: 0.40.0-canary.7 (global)
blitz: 0.40.0-canary.7 (local)

  Package manager: yarn
  System:
    OS: Windows 10 10.0.19042
    CPU: (12) x64 AMD Ryzen 5 1600 Six-Core Processor
    Memory: 1.87 GB / 7.95 GB
  Binaries:
    Node: 12.13.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 6.12.0 - C:\Program Files\nodejs\npm.CMD
    Watchman: Not Found
  npmPackages:
    @prisma/client: 2.30.2 => 2.30.2
    blitz: 0.40.0-canary.7 => 0.40.0-canary.7
    prisma: 2.30.2 => 2.30.2
    react: alpha => 18.0.0-alpha-46a0f050a-20210828
    react-dom: alpha => 18.0.0-alpha-46a0f050a-20210828
    typescript: ~4.3 => 4.3.5
flybayer commented 3 years ago

Thanks @regardt-nel, but I need the contents of node_modules/next/package.json, not your app package.json

regardt-nel commented 3 years ago

Sorry @flybayer ! Here you go ->

PS C:\Projects\TodoToday\node_modules\next> cat .\package.json
{
  "name": "@blitzjs/next",
  "version": "11.1.0-0.40.0-canary.7",
  "nextjsVersion": "11.1.0",
  "description": "The React Framework",
  "main": "./dist/server/next.js",
  "license": "MIT",
  "repository": "vercel/next.js",
  "bugs": "https://github.com/vercel/next.js/issues",
  "homepage": "https://nextjs.org",
  "types": "types/index.d.ts",
  "files": [
    "dist",
    "app.js",
    "app.d.ts",
    "babel.js",
    "babel.d.ts",
    "client.js",
    "client.d.ts",
    "config.js",
    "config.d.ts",
    "constants.js",
    "constants.d.ts",
    "data.js",
    "data.d.ts",
    "data-client.js",
    "data-client.d.ts",
    "document.js",
    "document.d.ts",
    "dynamic.js",
    "dynamic.d.ts",
    "error.js",
    "error.d.ts",
    "script.js",
    "script.d.ts",
    "head.js",
    "head.d.ts",
    "image.js",
    "image.d.ts",
    "link.js",
    "link.d.ts",
    "router.js",
    "router.d.ts",
    "amp.js",
    "amp.d.ts",
    "stdlib.js",
    "stdlib.d.ts",
    "stdlib-server.js",
    "stdlib-server.d.ts",
    "types/index.d.ts",
    "types/utils.ts",
    "types/global.d.ts",
    "image-types/global.d.ts"
  ],
  "bin": {
    "next": "./dist/bin/next"
  },
  "scripts": {
    "dev": "taskr",
    "release": "taskr release",
    "prepublish": "npm run release && yarn types",
    "types": "rimraf \"dist/**/*.d.ts\" && tsc --declaration --emitDeclarationOnly --declarationDir dist",
    "typescript": "tsc --noEmit --declaration",
    "ncc-compiled": "ncc cache clean && taskr ncc",
    "build-native": "napi build --platform --release --cargo-cwd build/swc native"
  },
  "taskr": {
    "requires": [
      "./taskfile-ncc.js",
      "./taskfile-swc.js"
    ]
  },
  "dependencies": {
    "@babel/helper-module-imports": "^7.0.0",
    "@babel/runtime": "7.12.5",
    "@hapi/accept": "5.0.2",
    "@next/env": "11.1.0",
    "@next/polyfill-module": "11.1.0",
    "@next/react-dev-overlay": "11.1.0",
    "@next/react-refresh-utils": "11.1.0",
    "@node-rs/helper": "1.2.1",
    "@types/secure-password": "3.1.0",
    "assert": "2.0.0",
    "ast-types": "0.13.2",
    "b64-lite": "^1.4.0",
    "bad-behavior": "^1.0.1",
    "browserify-zlib": "0.2.0",
    "browserslist": "4.16.6",
    "buffer": "5.6.0",
    "caniuse-lite": "^1.0.30001228",
    "chalk": "2.4.2",
    "chokidar": "3.5.1",
    "constants-browserify": "1.0.0",
    "cookie-session": "^1.4.0",
    "crypto-browserify": "3.12.0",
    "cssnano-simple": "3.0.0",
    "debug": "4.3.1",
    "domain-browser": "4.19.0",
    "encoding": "0.1.13",
    "esbuild": "^0.11.12",
    "etag": "1.8.1",
    "fs-extra": "^9.1.0",
    "get-orientation": "1.1.2",
    "https-browserify": "1.0.0",
    "image-size": "1.0.0",
    "jest-worker": "27.0.0-next.5",
    "native-url": "0.3.4",
    "node-fetch": "2.6.1",
    "node-html-parser": "1.4.9",
    "node-libs-browser": "^2.2.1",
    "null-loader": "4.0.1",
    "os-browserify": "0.3.0",
    "p-limit": "3.1.0",
    "passport": "0.4.1",
    "path-browserify": "1.0.1",
    "pnp-webpack-plugin": "1.6.4",
    "postcss": "8.2.15",
    "process": "0.11.10",
    "querystring-es3": "0.2.1",
    "raw-body": "2.4.1",
    "react-is": "17.0.2",
    "react-query": "3.16.0",
    "react-refresh": "0.8.3",
    "resolve-from": "^5.0.0",
    "secure-password": "4.0.0",
    "stream-browserify": "3.0.0",
    "stream-http": "3.1.1",
    "string_decoder": "1.3.0",
    "styled-jsx": "4.0.0",
    "superjson": "1.7.2",
    "timers-browserify": "2.0.12",
    "tslog": "^3.1.1",
    "tty-browserify": "0.0.1",
    "use-subscription": "1.5.1",
    "util": "0.12.3",
    "vm-browserify": "1.1.2",
    "watchpack": "2.1.1"
  },
  "peerDependencies": {
    "fibers": ">= 3.1.0",
    "node-sass": "^4.0.0 || ^5.0.0",
    "sass": "^1.3.0"
  },
  "peerDependenciesMeta": {
    "node-sass": {
      "optional": true
    },
    "sass": {
      "optional": true
    },
    "fibers": {
      "optional": true
    }
  },
  "devDependencies": {
    "@ampproject/toolbox-optimizer": "2.7.1-alpha.0",
    "@babel/code-frame": "7.12.11",
    "@babel/core": "7.12.10",
    "@babel/generator": "^7.12.10",
    "@babel/plugin-proposal-class-properties": "7.12.1",
    "@babel/plugin-proposal-export-namespace-from": "7.12.1",
    "@babel/plugin-proposal-numeric-separator": "7.12.7",
    "@babel/plugin-proposal-object-rest-spread": "7.12.1",
    "@babel/plugin-syntax-bigint": "7.8.3",
    "@babel/plugin-syntax-dynamic-import": "7.8.3",
    "@babel/plugin-syntax-jsx": "7.12.1",
    "@babel/plugin-transform-modules-commonjs": "7.12.1",
    "@babel/plugin-transform-runtime": "7.12.10",
    "@babel/preset-env": "7.12.11",
    "@babel/preset-react": "7.12.10",
    "@babel/preset-typescript": "7.12.7",
    "@babel/traverse": "^7.12.10",
    "@babel/types": "7.12.12",
    "@napi-rs/cli": "1.1.0",
    "@next/polyfill-nomodule": "11.1.0",
    "@taskr/clear": "1.1.0",
    "@taskr/esnext": "1.1.0",
    "@taskr/watch": "1.1.0",
    "@types/amphtml-validator": "1.0.0",
    "@types/babel__code-frame": "7.0.2",
    "@types/babel__core": "7.1.12",
    "@types/babel__generator": "7.6.2",
    "@types/babel__template": "7.4.0",
    "@types/babel__traverse": "7.11.0",
    "@types/ci-info": "2.0.0",
    "@types/compression": "0.0.36",
    "@types/content-type": "1.1.3",
    "@types/cookie": "0.3.3",
    "@types/cross-spawn": "6.0.2",
    "@types/debug": "4.1.5",
    "@types/etag": "1.8.0",
    "@types/fresh": "0.5.0",
    "@types/jsonwebtoken": "8.5.0",
    "@types/lodash.curry": "4.1.6",
    "@types/lru-cache": "5.1.0",
    "@types/node-fetch": "2.5.8",
    "@types/path-to-regexp": "1.7.0",
    "@types/react": "17.0.2",
    "@types/react-dom": "16.9.4",
    "@types/react-is": "16.7.1",
    "@types/semver": "7.3.1",
    "@types/send": "0.14.4",
    "@types/styled-jsx": "2.2.8",
    "@types/text-table": "0.2.1",
    "@types/webpack": "5.28.0",
    "@types/webpack-sources": "0.1.5",
    "@vercel/ncc": "0.27.0",
    "amphtml-validator": "1.0.33",
    "arg": "4.1.0",
    "async-retry": "1.2.3",
    "async-sema": "3.0.1",
    "babel-plugin-dynamic-import-node": "2.3.3",
    "babel-plugin-transform-define": "2.0.0",
    "babel-plugin-transform-react-remove-prop-types": "0.4.24",
    "bfj": "7.0.2",
    "cacache": "15.0.5",
    "ci-info": "watson/ci-info#f43f6a1cefff47fb361c88cf4b943fdbcaafe540",
    "cli-select": "1.1.2",
    "comment-json": "3.0.3",
    "compression": "1.7.4",
    "conf": "5.0.0",
    "content-type": "1.0.4",
    "cookie": "0.4.1",
    "cross-spawn": "7.0.3",
    "css-loader": "4.3.0",
    "devalue": "2.0.1",
    "escape-string-regexp": "2.0.0",
    "file-loader": "6.0.0",
    "find-cache-dir": "3.3.1",
    "find-up": "4.1.0",
    "fresh": "0.5.2",
    "gzip-size": "5.1.1",
    "http-proxy": "1.18.1",
    "ignore-loader": "0.1.2",
    "is-docker": "2.0.0",
    "is-wsl": "2.2.0",
    "json5": "2.2.0",
    "jsonwebtoken": "8.5.1",
    "loader-utils": "2.0.0",
    "lodash.curry": "4.1.1",
    "lru-cache": "5.1.1",
    "mini-css-extract-plugin": "1.5.0",
    "nanoid": "^3.1.20",
    "neo-async": "2.6.1",
    "ora": "^5.3.0",
    "path-to-regexp": "6.1.0",
    "postcss-flexbugs-fixes": "5.0.2",
    "postcss-loader": "4.3.0",
    "postcss-preset-env": "6.7.0",
    "postcss-scss": "3.0.5",
    "recast": "0.18.5",
    "resolve-url-loader": "3.1.2",
    "sass-loader": "10.0.5",
    "schema-utils": "2.7.1",
    "semver": "7.3.4",
    "send": "0.17.1",
    "source-map": "0.6.1",
    "string-hash": "1.1.3",
    "strip-ansi": "6.0.0",
    "taskr": "1.1.0",
    "terser": "5.7.1",
    "text-table": "0.2.0",
    "typescript": "4.4.2",
    "unistore": "3.4.1",
    "web-vitals": "2.1.0",
    "webpack": "4.44.1",
    "webpack-sources": "1.4.3"
  },
  "engines": {
    "node": ">=12.0.0"
  },
  "napi": {
    "name": "next-swc",
    "triples": {
      "defaults": true
    }
  },
  "gitHead": "5c219f1e6068df8bcacc8feb68e8a51eb5cfcee3",
  "blitzVersion": "0.40.0-canary.7"
}
flybayer commented 3 years ago

Closing in favor of https://github.com/blitz-js/blitz/issues/2727