Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while create-a-new-app steps in Introduction section #271

Closed
yogeshwar607 opened this issue May 14, 2021 · 4 comments · Fixed by blitz-js/blitz#2389
Closed

Error while create-a-new-app steps in Introduction section #271

yogeshwar607 opened this issue May 14, 2021 · 4 comments · Fixed by blitz-js/blitz#2389

Comments

@yogeshwar607
Copy link

What is the problem?

For the first time setup from blitzjs , using below commands throws error

  • blitz new myAppName
  • cd myAppName
  • blitz dev

Solution is after running prisma commands from here , its works fine

Issue is very small & easy to fix but might be problematic for new users

Paste all your error logs here:

![Uploading image.png…]()

Paste all relevant code snippets here:

image

What are detailed steps to reproduce this?

  1. Use blitz documentation first time setup

Run blitz -v and paste the output here:

macOS Catalina | darwin-x64 | Node: v14.16.1

blitz: 0.34.3 (global)
blitz: 0.34.3 (local)

  Package manager: yarn 
  System:
    OS: macOS 10.15.6
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 22.75 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.16.1 - /Users/yogi/.nvm/versions/node/v14.16.1/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.14.12 - /Users/yogi/.nvm/versions/node/v14.16.1/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: ~2.20 => 2.20.1 
    blitz: 0.34.3 => 0.34.3 
    prisma: ~2.20 => 2.20.1 
    react: 0.0.0-experimental-6a589ad71 => 0.0.0-experimental-6a589ad71 
    react-dom: 0.0.0-experimental-6a589ad71 => 0.0.0-experimental-6a589ad71 
    typescript: ~4.2 => 4.2.4 

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

No response

@flybayer
Copy link
Member

The solution is to manually run blitz prisma migrate and then run blitz dev.

However that shouldn't be needed. Probably there was an error during blitz new, but you didn't include that log in your post. Can you post that?

@yogeshwar607
Copy link
Author

yogeshwar607 commented May 19, 2021

@flybayer

Trying to replicate again , updated blitz to blitz: 0.35.0 (global) , got another error

blitz new commands is successful with below output , it created blitz.config.ts file but blitz dev is checking for blitz.config.js

Screenshot 2021-05-19 at 5 55 19 AM

blitz -v 
macOS Catalina | darwin-x64 | Node: v14.16.1

blitz: 0.35.0 (global)
blitz: 0.1.0 (local)

  Package manager: yarn 
  System:
    OS: macOS 10.15.6
    CPU: (8) x64 Intel(R) Core(TM) i5-8257U CPU @ 1.40GHz
    Memory: 70.86 MB / 8.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.16.1 - /Users/yogi/.nvm/versions/node/v14.16.1/bin/node
    Yarn: 1.21.1 - /usr/local/bin/yarn
    npm: 6.14.12 - /Users/yogi/.nvm/versions/node/v14.16.1/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: Not Found
    blitz: Not Found
    prisma: Not Found
    react: ^17.0.1 => 17.0.2 
    react-dom: ^17.0.1 => 17.0.2 
    typescript: Not Found


Error logs -

(node:5167) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/Users/funnel/Code/oss/influencer-marketing-UI/blitz.config.js'
    at Object.openSync (fs.js:476:3)
    at Object.readFileSync (fs.js:377:35)
    at Object.buildConfig (/Users/funnel/.config/yarn/global/node_modules/@blitzjs/config/dist/blitzjs-config.cjs.dev.js:71:30)
    at Object.run (/Users/funnel/.config/yarn/global/node_modules/@blitzjs/cli/lib/src/index.js:14:14)
    at main (/Users/funnel/.config/yarn/global/node_modules/blitz/cli/dist/blitz-cli.cjs.dev.js:94:9)
    at Object.<anonymous> (/Users/funnel/.config/yarn/global/node_modules/blitz/cli/dist/blitz-cli.cjs.dev.js:118:1)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:5167) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)
(node:5167) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

@jesseweed
Copy link

jesseweed commented May 20, 2021

I ran into a similar problem, I was able to get it to work eventually, but here's my repro steps for posterity:

  1. yarn global add blitz
  2. blitz new testapp
  3. Then I get this error straight away:
node:fs:487
  handleErrorFromBinding(ctx);
  ^

Error: ENOENT: no such file or directory, open '/Volumes/Web/projects/blitz.config.js'
    at Object.openSync (node:fs:487:3)
    at Object.readFileSync (node:fs:388:35)
    at Object.buildConfig (/Users/jesse/.config/yarn/global/node_modules/@blitzjs/config/dist/blitzjs-config.cjs.dev.js:71:30)
    at Object.run (/Users/jesse/.config/yarn/global/node_modules/@blitzjs/cli/lib/src/index.js:14:14)
    at main (/Users/jesse/.config/yarn/global/node_modules/blitz/cli/dist/blitz-cli.cjs.dev.js:94:9)
    at Object.<anonymous> (/Users/jesse/.config/yarn/global/node_modules/blitz/cli/dist/blitz-cli.cjs.dev.js:118:1)
    at Module._compile (node:internal/modules/cjs/loader:1102:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1131:10)
    at Module.load (node:internal/modules/cjs/loader:967:32)
    at Function.Module._load (node:internal/modules/cjs/loader:807:14) {
  errno: -2,
  syscall: 'open',
  code: 'ENOENT',
  path: '/Volumes/Web/projects/blitz.config.js'
}
  1. After that failing twice, I ran touch blitz.config.js
  2. run blitz new testapp one more time
  3. success!

So it seems that it's looking for a config file that's possibly incorrectly linked? It's possible there's meant to be a blitz.config.js file in that location, but it's a level up from the directory the app created in, so that doesn't seem right.

Weirdly, I tried again later in a new iTerm 2 tab, and it worked fine, no need to add a touch blitz.config.js file. So it could also just be that you need to switch to a new tab/window after install before running blitz new for the first time? ¯_(ツ)_/¯

Anyway, it works for me now, just some info in case it helps anybody later.

Here's my blitz -v:

macOS Big Sur | darwin-x64 | Node: v15.2.0

blitz: 0.35.0 (global)

  Package manager: npm
  System:
    OS: macOS 11.4
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 141.02 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 15.2.0 - ~/.fnm/current/bin/node
    Yarn: 1.22.10 - ~/.fnm/current/bin/yarn
    npm: 7.0.8 - ~/.fnm/current/bin/npm
    Watchman: Not Found
  npmPackages:
    @prisma/client: Not Found
    blitz: Not Found
    prisma: Not Found
    react: Not Found
    react-dom: Not Found
    typescript: Not Found

@flybayer
Copy link
Member

This should be fixed in https://github.com/blitz-js/blitz/releases/tag/v0.35.1

@dillondotzip dillondotzip transferred this issue from blitz-js/blitz Jul 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants