marko-js / marko

A declarative, HTML-based language that makes building web apps fun
https://markojs.com/
MIT License
13.39k stars 645 forks source link

Failed to do server-rendering bootstrapping (Non-Lasso) #908

Closed XianYeeXing closed 4 years ago

XianYeeXing commented 6 years ago

Bug Report

Marko Version: 4.5.x

Details

Error messages occur once trying to initialize and mount all of the server-rendered UI components by calling "require('marko/components').init()":

Uncaught TypeError: Cannot read property 's0-3' of undefined
at morphChildren (index.js:208)
at morphdom (index.js:517)
at Component.js:475
at Object.batchUpdate [as ___batchUpdate] (update-manager.js:63)
at Component.___rerender (Component.js:458)
at initComponent (init-components-browser.js:103)
at init-components-browser.js:261
at Array.forEach (<anonymous>)
at Object.initServerRendered [as concat] (init-components-browser.js:198)
at (index):1

Everything works fine ob version 4.4.x though...

XianYeeXing commented 6 years ago

Temporarily make a work-around in src/morthdom/index.js: 208

if (existingComponentLookup === undefined || (matchingFromComponent = existingComponentLookup[componentForNode.id]) === undefined) {...}
austinkelleher commented 6 years ago

@XianYeeXing Thanks for reporting this issue. You're using webpack right? I tried the marko-webpack with the marko@4.5.61 and I am not seeing this issue. Can you provide a sample project or code sample that reproduces this issue? Thanks!

XianYeeXing commented 6 years ago

I am using browserify(14.4.0) with markoify(2.2.2) ^^b

austinkelleher commented 6 years ago

@XianYeeXing Just wanted to follow up and say there are definitely some gaps in our markoify plugin. It didn't get fully updated when we moved to Marko v4. I would recommend using webpack or Lasso in the meantime.

marko-webpack sample app marko-lasso sample app

DylanPiercey commented 4 years ago

We are no longer maintaining the Browserify plugin, I recommend using one of our up to date plugins (Webpack, Rollup or Lasso).