Blitz: Installing tailwindcss breaks build on a fresh project

Created on 5 Jul 2020  ·  5Comments  ·  Source: blitz-js/blitz

What is the problem?

Installing tailwindcss, and potentially other dependencies, is breaking a fresh blitz app.

Steps to Reproduce

  1. npm i -g blitz
  2. blitz new blitz-test
  3. cd blitz-test
  4. npm run start / blitz start ✅ Works!
  5. Stop dev server
  6. npm i tailwindcss with no further changes to anything
  7. npm run start / blitz start ❌ Fails!

Seems to cause _all_ blitz cli commands in the blitz working directory to fail.

Versions

output of `blitz --version --verbose`

macOS Catalina | darwin-x64 | Node: v12.16.3
blitz: 0.16.1 (global)

However running inside the working directory...

matthewbrookson@Matthews-MBP blitz % blitz --version --verbose
You are using alpha software - if you have any problems, please open an issue here:
  https://github.com/blitz-js/blitz/issues/new/choose

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

Error: Cannot find module '/Users/matthewbrookson/SourceCode/Home/blitz/node_modules/@blitzjs/cli'
Require stack:
- /Users/matthewbrookson/npm-global/lib/node_modules/blitz/dist/cli.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:957:15)
    at Function.Module._load (internal/modules/cjs/loader.js:840:27)
    at Module.require (internal/modules/cjs/loader.js:1019:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at Object.<anonymous> (/Users/matthewbrookson/npm-global/lib/node_modules/blitz/dist/cli.js:50:11)
    at Module._compile (internal/modules/cjs/loader.js:1133:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
    at Module.load (internal/modules/cjs/loader.js:977:32)
    at Function.Module._load (internal/modules/cjs/loader.js:877:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/matthewbrookson/npm-global/lib/node_modules/blitz/dist/cli.js'
  ]
}

Other

image

kinbug statudone

All 5 comments

Thanks for reporting this @mbrookson! I can't reproduce, but I'm looking into it.

No problem. Couple of other interesting points.

  • My existing NextJS project that I've started converting didn't seem to have the same issue for some reason, but will try again to see if something has changed.
  • I have my global npm modules configured to go into ~/npm-global rather than the npm default global location. Doubt it but wondered if this might affect any path finding stuff blitz uses 🤷‍♂️
  • I ran npm i -g blitz again just to make sure my global install hadn't messed up, but still happened.
  • I checked multiple times and was consistently able to reproduce this issue with fresh blitz projects

Will do some more investigation of my own tonight too.

@mbrookson this should be fixed now in 0.16.2! Re-open this issue if it's not :)

Thanks for the speedy fix @flybayer! Will test out later today.

@flybayer Can confirm this issue is fixed in 0.16.2 👍

Was this page helpful?
0 / 5 - 0 ratings

Related issues

netheril96 picture netheril96  ·  4Comments

svobik7 picture svobik7  ·  3Comments

LoriKarikari picture LoriKarikari  ·  4Comments

SharadKumar picture SharadKumar  ·  3Comments

flybayer picture flybayer  ·  4Comments