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

[examples] Getting a 404 for commit-table-ssr example #46

Closed
allforabit opened this issue Sep 24, 2018 · 4 comments
Closed

[examples] Getting a 404 for commit-table-ssr example #46

allforabit opened this issue Sep 24, 2018 · 4 comments

Comments

@allforabit
Copy link
Contributor

Hi Karsten, I'm really excited to see all the new developments with rstream and hdom. I'm having a little trouble running the commit-table-ssr example. I'm getting a 404 for the client code and the following text is output: Cannot GET /out/ I'm also getting this (possibly unrelated error) after yarn install:

Done in 0.09s.
cp: cannot stat 'commits.json': No such file or directory
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

P.s. I know I said I'd look into this issue a while back. #23 It's still on my radar and hope to get back to it soon! I've been busy doing react based dev work and unfortunately umbrella has taken a backseat for now.

@postspectacular
Copy link
Member

Hi @allforabit - I'm not quite sure what's going on but I just learned that yarn auto-executes a "prepare" script alias (which is present in this example) at the end of yarn install. I renamed the command to "prep" only and it seems to do the trick. That command & the commits.json file is only used for me to upload the demo to S3...

I've updated the server to write that file (commits.json) now each time commits are missing from the cache.

I still don't understand though why you'd get a 404. Are you seeing the following when you install & start the app?

rm -rf yarn.lock node_modules/ commits.json

yarn install
yarn install v1.9.4
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning parcel-bundler > htmlnano > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning parcel-bundler > htmlnano > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning parcel-bundler > htmlnano > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning parcel-bundler > serialize-to-js > js-beautify > editorconfig > @types/commander@2.12.2: This is a stub types definition for commander (https://github.com/tj/commander.js). commander provides its own type definitions, so you don't need @types/commander installed!
[2/4] 🚚  Fetching packages...
[-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------] 0/694(node:91031) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
[3/4] 🔗  Linking dependencies...
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 18.88s.

yarn start
yarn run v1.9.4
$ tsc && node build/server/index.js
⠋ Building...starting server @ http://localhost:8080
✨  Built in 2.44s.

Did you try navigating to just http://localhost:8080 (without the extra /out/ path)? It should redirect you there automatically...

postspectacular added a commit that referenced this issue Sep 24, 2018
- rename `prepare` => `prep` to avoid autoexec during `yarn install`
- add getCommits() to retrieve commits for caching and
  write to `commits.json`
- commits.json stub file
@allforabit
Copy link
Contributor Author

I get something fairly similar when running the commands:

>yarn
yarn install v1.7.0
info No lockfile found.
[1/4] Resolving packages...
warning parcel-bundler > htmlnano > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning parcel-bundler > htmlnano > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning parcel-bundler > htmlnano > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning parcel-bundler > serialize-to-js > js-beautify > editorconfig > @types/commander@2.12.2: This is a stub types definition for commander (https://github.com/tj/commander.js). commander provides its own type definitions, so you don't need @types/commander installed!
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "win32" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 68.31s.

>yarn start
yarn run v1.7.0
$ tsc && node build/server/index.js
- Building...starting server @ http://localhost:8080
√  Built in 122ms.

I'm still getting the 404 though.

I see server/index.js references an index.html. I don't see this file present in the repo though. Maybe this has been excluded?

const bundler = new Bundler("index.html", {
    outDir: "./out",
    outFile: "index.html",
    publicUrl: "/out",
});

@postspectacular
Copy link
Member

Pull & try again please! :) Sorry about that!

@allforabit
Copy link
Contributor Author

Works perfectly now thanks!

postspectacular added a commit that referenced this issue Oct 13, 2018
* develop: (125 commits)
  Publish
  docs(vectors): fix docstrings, hide CommonOpts type alias
  refactor(vectors): generate more ops, move declareIndices() (#51)
  refactor(vectors): rewrite codegen, add more types & gen ops (#51)
  refactor(vectors): use codegen for unary vec2/3/4 ops
  feat(vectors): add vector ops codegen, update basic vec2/3/4 ops (#51)
  docs(hdom): add xml-converter example link & screenshot
  feat(examples): add copy-to-clipboard, extract UI config & components
  feat(examples): update css
  fix(examples): fix attrib format
  feat(examples): extend xml-converter, add CLI version, update docs
  Publish
  minor(examples): xml-converter
  docs(hdom): add/update docs (fix #47)
  fix: update .gitignore (fixes #46, fixes #50)
  refactor(examples): refactor hiccup formatter, minor fixes
  fix(transducers): fix matchLast(), fix & update return match*() types
  fix(examples): add null check & parseAttrib() in transformCSS()
  fix(examples): add missing index.html (#46)
  Publish
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants