Giter VIP home page Giter VIP logo

Comments (26)

stereobooster avatar stereobooster commented on May 14, 2024

Are you looking at generated html or browser output?

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

The generated html
On viewing source in the browser, it shows the same.

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

This is a strange bug. I will need reproducible demo for this.

https://github.com/stereobooster/react-snap/blob/master/index.js#L174

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

I am currently using code-splitting with react-snap
react-snap.zip

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

This is what I see (in given example)

<link href="/static/css/app.fb2d5da5.css" rel="preload" as="style" onload="this.rel='stylesheet'">

which is correct

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

Which OS are you using?
I think puppeteer doesn't work well with all OS's

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

I use MacOS X. Which system do you use?

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

I have two systems. The link preload works on windows 10 but not on Ubuntu.

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

Ok I will check Ubuntu. But this will take some time

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

Thank you.
And is it possible to use PhantomJS instead of Puppeteer?

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

is it possible to use PhantomJS instead of Puppeteer?

Doesn't make any sense. PhantomJS (theoretically) have much more bugs. Puppeteer is official product of Chrome team. If we will be able to prove this is the bug of Puppeteer we can open issue in their tracker

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

This error also came up once

Crawled 3 out of 5 (/about)
(node:3300) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ReferenceError: webpackJsonp is not defined
    at http://localhost:45674/static/js/home.c6d8ef6f.chunk.js:1:1
(node:3300) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Is this error causing the problem?

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

this error is caused by webpack dynamic import https://github.com/stereobooster/react-snap#webpack-2-and-dynamic-import. I want to change it so this option would be enabled by default see #36

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

I found this on line 207 in the fixWebpackChunksIssue method
const mainRegexp = /main\.[\w]{8}.js/;

But create-react-app generates a bundle.js. So shouldn't the code be
const mainRegexp = /bundle\.[\w]{8}.js/;

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

which version of c-r-a do you use? I wonder when this changed

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

I am using [email protected]

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

Version of react-scripts?

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

1.0.16

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

still can not reproduce

this is my Vagrantfile

Vagrant.configure("2") do |config|
  config.vm.box = "ubuntu/trusty64"
  config.vm.provision "shell", inline: <<-SHELL
    curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
    apt-get update
    apt-get install -y gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget
    apt-get install -y nodejs
    apt-get install -y build-essential
    cd /vagrant
    npm install
  SHELL
end
vagrant up
vagrant ssh
cd /vagrant
npm run-script build
node -v
v8.9.1
npm -v
5.5.1

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

If I comment out link.setAttribute("onload", "this.rel='stylesheet'");, the rel propery is set to preload. Otherwise it remails 'stylesheet'

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

this is how it suppose to be. Read about async style loading https://www.npmjs.com/package/fg-loadcss

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

I reproduced it on Windows 8.1 and Arch Linux. Seems to be platform specific.
I also get this error on Windows 8.1

ERROR: The process with PID 3544 (child process of PID 3896) could not be terminated.
Reason: The operation attempted is not supported.
(node:3092) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: Command failed: taskkill /pid 3896 /T /F
ERROR: The process with PID 3544 (child process of PID 3896) could not be terminated.
Reason: The operation attempted is not supported.

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

link.setAttribute("onload", "this.rel='stylesheet'");

In the above line, the onload code is being executed as I also tried another line
link.setAttribute("onload", "this.rel='alternate stylesheet'");

The rel property was set to
rel="alternate stylesheet"

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

As of windows problem - I can not help with that. I do not have windows machine. Try to look similar problem in puppeteer.

As of link.setAttribute not sure what you want to change. This is intended behaviour. Read about async css load technique by Filament Group, Inc. You can easily change this, by creating your own fork. This npm package is installable via git - it does not have compilation steps.

from react-snap.

ryan-ds17 avatar ryan-ds17 commented on May 14, 2024

Is it possible to omit pages to be prerendered. Like the profile page is user-specific so ideally that should not be preloaded.

from react-snap.

stereobooster avatar stereobooster commented on May 14, 2024

but how crawler gets to this page? don't you need to be loged in?

from react-snap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.