blocks-template icon indicating copy to clipboard operation
blocks-template copied to clipboard

Clone, install, build, start? Fail.

Open StoneCypher opened this issue 3 years ago • 4 comments

Hiya. Super excited to try this. Windows 10 up to date, npm, running from git bash. Started from a fork of your repo, otherwise unaltered.

  • git clone works
  • npm install works
  • npm build works
  • npm start fails three ways
    1. On starting, announces that it cannot resolve react-dom/client (1)
    2. Immediately replaces that message with a cullscreen clear, where vite yields a failure about being unable to resolve the same library (2)
    3. Yields an in-browser error regarding this when hit in browser (3)

1:

image


2:

image


3:

image


I tried manually installing react-dom as a dev dep; didn't help.

StoneCypher avatar Nov 13 '22 16:11 StoneCypher

Confirmed same behavior in dos console and powershell

StoneCypher avatar Nov 13 '22 16:11 StoneCypher

Confirmed same behavior when switching to yarn, even when removing yarn-lock and package-lock then reinstalling as from #28 first

StoneCypher avatar Nov 13 '22 17:11 StoneCypher

Tried to build an alpine image and build in there.

If you mount the existing directory, esbuild complains that it was built for a different platform

If you try to install internally, esbuild complains that it can't figure out what platform it is

StoneCypher avatar Nov 13 '22 19:11 StoneCypher

Set up an actual Ubuntu machine.

Works as expected there

Looks like even local dev has us waitlisted though 😢

image

StoneCypher avatar Nov 13 '22 21:11 StoneCypher

Fixed in https://github.com/githubnext/blocks-template/commit/246887e28444c326185fa8e1fb958aed1d0ce29b!

The underlying issue was that @primer/react expressed a peer dep of react 17.x, whereas everything else we use relies on react 18. The way yarn writes dependencies to disk was fine (it installs react 18) but npm would "vendor" in the node_modules for primer/react, which included react 17. Subsequent attempts to load react-dom/client would fail.

Thank you for the bug report!

idan avatar Dec 09 '22 03:12 idan