bundlerUrl: bundle.js: Uncaught SyntaxError: Unexpected token < #61
Comments
Does the with-razzle example work for you? That's how I would recommend getting started as The And yes, you're correct, the client bundle is used after initial server render. Rogue adds a script to the document that tells browser where to look for it: https://github.com/alidcastano/rogue.js/blob/master/packages/rogue-app/lib/server/toHtml.ts#L25 |
@alidcastano Thanks for the quick response. The razzle one works for me, but I have tried zero config with @rogue/cli and only with App.js. That produced same I have this server.js and I am running it with import Rogue from '@roguejs/app/server';
import http from 'http';
import App from './app/App';
const rogue = new Rogue(App, {});
const server = http.createServer(rogue.render);
server.listen(3000, error => {
if (error) {
console.log(error);
}
console.log('🚀 started');
}); The App React component renders just plain 'Hello World' string. Maybe I need newer node.js? I am running Probably I just go with razzle even though I wanted to set things up for myself manually first. |
The bundleUrl needs to point to the compiled client bundle so in your case, if you're in development, it'll be relative to wherever let me know if you can get it to work, otherwise if you can make a tiny example I can check it out |
@alidcastano Thanks for the answer. Yeah, it was the problem with the wrong relative path to bundle. Now it works. Anyway, I am now using |
I am running rogue.js version 0.6.10 and still getting this issue for bundle.js. Mentioned in #20.
I am also new to SSR and I don't know if I figured out what is the right purpose for this bundle. Should it be compiled client side (client.js) script for usage when continuing with an app on the browser side after initial server render?
razzle example uses some client.js script so I don't know, because when I build the app via @roguejs/cli the bundle.js contains ES5 version of server.js code, but that may be the error and because of it I got confused.
Thanks for answer.
Keep up the great work. Rogue.js will be awesome.
The text was updated successfully, but these errors were encountered: