This is real weird one, I've upgrading my webpack to version 4 on my project based on reactql 3.0, and I'm hitting a snag where I can't pump in dynamic values of the manifest, and start the server. When I go to start the server after a build, the server complains about calling map on Object.values.
import path from 'path'
import {readFileSync} from 'fs'
import PATHS from 'config/paths'
import {logServerStarted} from 'kit/lib/console'
import server, {createReactHandler, staticMiddleware} from './server'
const [manifest] = ['manifest']
.map((name) => JSON.parse(readFileSync(path.resolve(PATHS.dist, `${name}.json`), 'utf8')))
console.log(manifest)
// Get manifest values
const css = manifest['browser.css']
const scripts = Object.values(manifest).map((item) => item.match('.js'))
// Spawn the development server.
// Runs inside an immediate `async` block, to await listening on ports
(async () => {
const {app, router, listen} = server
// Connect the production routes to the server
router.get('/*', createReactHandler(css, scripts))
app
.use(staticMiddleware())
.use(router.routes())
.use(router.allowedMethods())
// Spawn the server
listen()
// Log to the terminal that we're ready for action
logServerStarted({
type: 'server'
})
})()
While the app builds starting the server gives me a peculiar error...
`},function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BlogArticleInfo=t.CoverImage=t.PublishNote=t.BlogArticleItem=t.BlogArticlesContainer=void 0;var n,o=a(3),r=(n=o)&&n.__esModule?n:{default:n},i=a(12);t.BlogArticlesContainer=r.default.div.withConfig({displayName:"BlogArticlesContainer",componentId:"sc-1xmfwqk-0"})(["display:flex;flex-flow:column;justify-content:center;align-items:center;padding:10px;"]),t.BlogArticleItem=r.default.div.withConfig({displayName:"BlogArticleItem",componentId:"sc-1xmfwqk-1"})(["display:flex;flex-flow:column;align-items:center;justify-content:center;color:#555;"]),t.PublishNote=r.default.div.withConfig({displayName:"PublishNote",componentId:"sc-1xmfwqk-2"})(["display:flex;justify-content:flex-start;align-items:center;max-width:640px;margin:10px auto 20px auto;color:#555;"]),t.CoverImage=r.default.img.withConfig({displayName:"CoverImage",componentId:"sc-1xmfwqk-3"})(["max-width:640px;ju
TypeError: Object.values(...).map(...) is not a function
at Object.defineProperty.value (/Users/patricklemiuex/projects/iflipd-reactql/dist/server.js:236:51991)
at a (/Users/patricklemiuex/projects/iflipd-reactql/dist/server.js:1:172)
at Object.<anonymous> (/Users/patricklemiuex/projects/iflipd-reactql/dist/server.js:236:51645)
at a (/Users/patricklemiuex/projects/iflipd-reactql/dist/server.js:1:172)
at /Users/patricklemiuex/projects/iflipd-reactql/dist/server.js:1:964
at Object.<anonymous> (/Users/patricklemiuex/projects/iflipd-reactql/dist/server.js:1:975)
at Module._compile (module.js:662:30)
at Object.Module._extensions..js (module.js:673:10)
at Module.load (module.js:575:32)
at tryModuleLoad (module.js:515:12)
at Function.Module._load (module.js:507:3)
at Function.Module.runMain (module.js:703:10)
at startup (bootstrap_node.js:193:16)
at bootstrap_node.js:665:3
npm ERR! code ELIFECYCLE```
I'm definitely operating on an array, it's as if the server is getting called twice, or something really odd.. Not sure if you can shed any light, it's very frustrating.
Thanks for your time, i know this isn't your problem, it's a my problem, but any light you can shed will be appreciated
This is real weird one, I've upgrading my webpack to version 4 on my project based on reactql 3.0, and I'm hitting a snag where I can't pump in dynamic values of the manifest, and start the server. When I go to start the server after a build, the server complains about calling map on Object.values.
Here's the value of my manifest
Here's what I have:
While the app builds starting the server gives me a peculiar error...