Skip to content

self is not defined at ../build/prerender.js: #5

@splendidtrade

Description

@splendidtrade

@Alex-ray Thanks for your reply - yes I watched your video walk through and I am pretty clear now - how it works. I have couple more questions -

when I run npm build and npm start prod set up I am getting
ReferenceError: self is not defined
at ../build/prerender.js:32:2098
is it because of the css/sass loaders I have? This is my loader configuration - I basically have 1 main.scss and include rest of the component specific css within this file -
{ test: /.(png|jpg|jpeg|gif|svg)$/, loader: 'url-loader?name=img/img-[hash:6].[ext]&limit=5000' },
{
test: /.scss/,
loader: [
'style-loader',
{
loader: 'css-loader',
options: {
sourceMap: true,
url: false
}
},
{
loader: 'sass-loader',
options: {
sourceMap: true,
url: false
}
}
]
},

const makeRoutes = require('../../build/prerender');
const routes = makeRoutes(store);
why do we need to take it as a bundle here - can we not pass directly 1 route file?

And last question - which is the right place to make a call to external API and how do I pass in the data coming back into appropriate components? can I take counter.js actions as an example? but I dont see we are injecting actual data from server anywhere. Could you please give me some direction here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions