roxiness / stackmix

A collection of templates for Routify.
22 stars 2 forks source link

First run experience for routify-templates #10

Closed Wolfr closed 3 years ago

Wolfr commented 3 years ago

I decided to give routify-templates a try.

My comments below!

Not sure why it is downloading the whole of Playwright for me. Feels a bit heavy to download 250Mb+ worth of browsers?

I used these options:

✔ Pick a bundler. Combine at your own risk. › **rollup**
✔ Pick a template. Combine at your own risk. › **single-page**
✔ Pick features. › markdown, postcss, vercel
✔ Pick content. › content
✔ Misc › dev

Then when I try to run, spassr is not included, so my first run fails. Here's the package.json (abbreviated):

{
  "name": "routify-app",
  "version": "1.0.0",
  "@comments scripts": {
    "dev": "run all dev:* scripts",
    "dev:routify": "generate Routify's routes.js on filechange",
    "build": "run all build:* scripts",
    "build:routify": "build routify",
    "serve": "serve content in 'dist' folder"
  },
  "scripts": {
    "dev": "run-p dev:* serve:*",
    "dev:routify": "routify",
    "serve": "run-p serve:*",
    "serve:spa": "spassr",
    "serve:ssr": "spassr --ssr --port 5005",
    "build": "cross-env NODE_ENV=production run-s build:*",
    "build:routify": "routify -b",
    "test": "npm run test:dev && npm run test:build",
    "test:dev": "node test/lib/wrapper dev ava test/{common,dev}/**/*.test.js",
    "test:build": "node test/lib/wrapper build ava test/{common,build}/**/*.test.js"
  },
  "devDependencies": {
    "@roxi/routify": "^2.14.0",
    "@ava/cooperate": "^0.1.0",
    "fkill": "^7.1.0",
    "npm-run-all": "^4.1.5",
    "svelte": "^3.35.0",
    "playwright": "^1.8.0",
    "cross-env": "^7.0.3",
    "mdsvex": "^0.8.9",
    "remark-slug": "^6.0.0",
    "routify-plugin-frontmatter": "^1.0.1",
    "svelte-preprocess": "^4.6.3",
    "postcss": "^8.2.4"
  },
  (...)
}

So I am thinking this need spassr and doesn't need playwright.

If I install spassr:

npm i spassr

I get it to run.

But then it fails to build, and I get a blank page on localhost:5000

[spassr] Serving ssr on localhost:5005
 > error: Could not resolve "dist/build/main.js"

1 error
[tossr] Error on url: /
[tossr] Unhandled promise rejection:
[tossr] Error: Build failed with 1 error:
error: Could not resolve "dist/build/main.js"
    at failureErrorWithLog (/Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:1160:15)
    at buildResponseToResult (/Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:896:32)
    at /Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:991:20
    at /Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:542:9
    at handleIncomingPacket (/Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:631:9)
    at Socket.readFromStdout (/Users/johanronsse/Sites/routify-templates/output/node_modules/esbuild/lib/main.js:509:7)
    at Socket.emit (events.js:210:5)
    at addChunk (_stream_readable.js:309:12)
    at readableAddChunk (_stream_readable.js:290:11)
    at Socket.Readable.push (_stream_readable.js:224:10) {
  errors: [
    {
      detail: undefined,
      location: null,
      notes: [],
      text: 'Could not resolve "dist/build/main.js"'
    }
  ],
  warnings: []
}
 > error: Could not resolve "dist/build/main.js"

1 error
jakobrosenberg commented 3 years ago

Thanks for the feedback, @Wolfr. 👍

jakobrosenberg commented 3 years ago

All working for me now. I'm closing this for now. 🙂

Wolfr commented 3 years ago

Cool 👍!

Maybe make playwright optional, downloading it took a while which made for a non-satisfactory first run experience.