Skip to content

Instantly share code, notes, and snippets.

@skunkworker
Created January 1, 2020 09:46
Show Gist options
  • Save skunkworker/22b7e283ee900f3d347ccce3eb308c20 to your computer and use it in GitHub Desktop.
Save skunkworker/22b7e283ee900f3d347ccce3eb308c20 to your computer and use it in GitHub Desktop.
How to use hypernova-vue with rails
console.log("hello vue")
const Vue = require("vue")
// const renderVue = require("hypernova-vue").renderVue // this throws an error.
const renderVue = require("hypernova-vue/server").renderVue
const MyComponentX = Vue.extend({
template: '<h1>hello world</h1>'
})
module.exports = renderVue("VueComponent.js", MyComponentX)
Development Warning! The 0 component failed to render with Hypernova. Error stack:
Error: Use hypernova-vue/server instead
at Object.server (/Users/john/dev/github/relevant-jobs/node_modules/hypernova-vue/lib/index.js:51:15)
at Object.hypernova [as default] (/Users/john/dev/github/relevant-jobs/node_modules/hypernova/lib/index.js:101:49)
at exports.renderVue (/Users/john/dev/github/relevant-jobs/node_modules/hypernova-vue/lib/index.js:49:61)
at Object.<anonymous> (/Users/john/dev/github/relevant-jobs/app/javascript/ssr/component.js:10:18)
at Module._compile (internal/modules/cjs/loader.js:1139:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
at Module.load (internal/modules/cjs/loader.js:988:32)
at Function.Module._load (internal/modules/cjs/loader.js:896:14)
at Module.require (internal/modules/cjs/loader.js:1028:19)
at require (internal/modules/cjs/helpers.js:72:18)
at getComponent (/Users/john/dev/github/relevant-jobs/server.js:9:14)
at BatchManager.render (/Users/john/dev/github/relevant-jobs/node_modules/hypernova/lib/utils/BatchManager.js:180:22)
at /Users/john/dev/github/relevant-jobs/node_modules/hypernova/lib/utils/lifecycle.js:179:22
at tryCatcher (/Users/john/dev/github/relevant-jobs/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/Users/john/dev/github/relevant-jobs/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/Users/john/dev/github/relevant-jobs/node_modules/bluebird/js/release/promise.js:604:18)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment