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

Try prerender-trigger event only after body has been updated to make sure Elm has rendered. #61

Merged
merged 3 commits into from
Jan 30, 2020

Conversation

dillonkearns
Copy link
Owner

Fixes #40.

@icidasset
Copy link
Contributor

icidasset commented Jan 29, 2020

Hey 👋 I wanted to test this, but I'm getting the following error. Probably not because of this PR though? Error seems to come from generator/src/add-files-plugin.js:57

emittingTypeError: Cannot read property 'forEach' of undefined
    at /Users/icidasset/Work/fission-landing-prototype/node_modules/elm-pages/generator/src/add-files-plugin.js:57:28
    at AsyncSeriesHook.eval [as callAsync] (eval at create (/Users/icidasset/Work/fission-landing-prototype/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:78:1)
    at AsyncSeriesHook.lazyCompileHook (/Users/icidasset/Work/fission-landing-prototype/node_modules/tapable/lib/Hook.js:154:20)
    at Compiler.emitAssets (/Users/icidasset/Work/fission-landing-prototype/node_modules/webpack/lib/Compiler.js:491:19)
    at onCompiled (/Users/icidasset/Work/fission-landing-prototype/node_modules/webpack/lib/Compiler.js:278:9)
    at /Users/icidasset/Work/fission-landing-prototype/node_modules/webpack/lib/Compiler.js:681:15
    at eval (eval at create (/Users/icidasset/Work/fission-landing-prototype/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:13:1)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
 ERROR  Command failed with exit code 1.

Installed using yarn with this package.json:

{
  "private": true,
  "scripts": {
    "dev": "elm-pages develop",
    "build": "elm-pages build"
  },
  "devDependencies": {
    "elm": "latest-0.19.1",
    "elm-format": "^0.8.2",
    "elm-git-install": "^0.1.2",
    "elm-pages": "dillonkearns/elm-pages#prerender-trigger-after-view-function"
  }
}

@dillonkearns
Copy link
Owner Author

Hmm, maybe try this? npm install --save dillonkearns/elm-pages#prerender-trigger-after-view-function

I'm not so familiar with that syntax, could be a yarn vs npm issue?

Properly setup the `renderAfterDocumentEvent` option
@dillonkearns
Copy link
Owner Author

Closing in favor of #62.

@dillonkearns dillonkearns moved this from In progress to Released in Roadmap Jan 30, 2020
@icidasset
Copy link
Contributor

@dillonkearns Um, so sorry, but, my PR was actually set to merge into this PR. So you should merge this one into master. No changes are in master now 👀

@dillonkearns
Copy link
Owner Author

Whoops, I just saw that

@dillonkearns dillonkearns reopened this Jan 30, 2020
@dillonkearns dillonkearns merged commit 2059dd0 into master Jan 30, 2020
@dillonkearns
Copy link
Owner Author

Released as NPM package version 1.2.4 👍

@dillonkearns dillonkearns deleted the prerender-trigger-after-view-function branch May 11, 2020 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Roadmap
  
Released
Development

Successfully merging this pull request may close these issues.

HTML from build sometimes doesn't include content
2 participants