Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Server side rendered components require server restart to take effect #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
WonSong opened this issue Jun 20, 2018 · 18 comments
Closed

Server side rendered components require server restart to take effect #554

WonSong opened this issue Jun 20, 2018 · 18 comments

Comments

@WonSong
Copy link

WonSong commented Jun 20, 2018

Using ASP.NET Core 2.1
Webpack 4
Typescript 2.9

@Daniel15
Copy link
Member

@WonSong - If you attach a debugger, do you see messages like this when you change the files?

[JSPool] Watched file 'foo.js' changed

@dustinsoftware Do you have any ideas on this? We do configure JSPool to recycle the pool on change:

WatchPath = _fileSystem.MapPath("~/"),
WatchFiles = allFiles

And then JSPool uses a FileSystemWatcher:

https://github.com/Daniel15/JSPool/blob/master/src/JSPool/FileWatcher.cs#L90-L102

Perhaps we're not passing the file names correctly, or passing the wrong path, or something like that.

@dustinsoftware
Copy link
Member

dustinsoftware commented Jun 20, 2018

I was able to repro this issue with webpack 4. Try downgrading to webpack 3 and see if you're still having problems.

I'm still investigating but want to rule out changes within webpack itself.

@dustinsoftware
Copy link
Member

dustinsoftware commented Jun 20, 2018

The webpack 4 issue I thought I was encountering was a red herring, webpack 4 changed the default destination to dist so my changes weren't going to the right folder like I thought they were :) One thing I didn't ask earlier, are you using Windows or another platform?

@WonSong
Copy link
Author

WonSong commented Jun 20, 2018

On Windows

@WonSong
Copy link
Author

WonSong commented Jun 20, 2018

I created a sample app, but seeing the same issue on Mac. Here's the repo: https://github.com/WonSong/ReactDotNetTypeScriptWebpackDemo

@dustinsoftware
Copy link
Member

Thanks @WonSong. I'll look at this in the next few days.

@vezaynk
Copy link

vezaynk commented Jul 20, 2018

I have wasted a lot of time struggling with this. Is there an ETA?

@dustinsoftware
Copy link
Member

dustinsoftware commented Jul 20, 2018 via email

@vezaynk
Copy link

vezaynk commented Jul 20, 2018

I no longer have a project using it. The general buginess and unreliability of it made me switch away.

@dustinsoftware
Copy link
Member

dustinsoftware commented Jul 20, 2018 via email

@dustinsoftware
Copy link
Member

Sorry, that response may have come across as terse. I intend to debug this problem but can’t do so without detailed information about the environment this library runs in, since the bug hasn’t occurred when I have attempted to repro it.

@WonSong
Copy link
Author

WonSong commented Jul 20, 2018

i still have this issue in ASP.NET Core MVC 2.1.301 both on 64bit latest MacoOs and 64bit windows 10. Still using same template as the one I provided above.

@dustinsoftware
Copy link
Member

Ok, so here's what I did to try and repro the issue (no luck). Please let me know if I am missing something. .NET Core 2.1 on OS X.

  1. Cloned your repo
  2. yarn to restore packages
  3. yarn start to run webpack
  4. dotnet run to start the dev server
  5. Opened the browser, saw components render successfully
  6. Made a component render change in Hello.tsx
  7. Observe that the server-rendered change worked when reloading the window

@vezaynk
Copy link

vezaynk commented Jul 24, 2018

Interestingly, once I disabled the re-use of the rendering engine, it ceased to be an issue. Could it be that a renderer is persisting through the updates?

@LinusCenterstrom
Copy link

Having the same issue here, turning off re-use fixed it for me too (I'm running version 3.2 on aspnet core 2.1).
Been running it in a Mvc 4 app for a long time without seeing this issue (exact same configuration and bundle), so it seems to be core-specific.

I've temporarily turned off re-use of the rendering engine when running locally and I would recommend anyone else to do the same as a workaround until this is fixed.

Let me know if you need anymore information to identify the problem.

@dustinsoftware
Copy link
Member

dustinsoftware commented Aug 10, 2018 via email

@dustinsoftware
Copy link
Member

Ok I've finally nailed down a repro. Digging further.

dustinsoftware added a commit to dustinsoftware/React.NET that referenced this issue Aug 12, 2018
dustinsoftware added a commit to dustinsoftware/React.NET that referenced this issue Aug 12, 2018
dustinsoftware added a commit to dustinsoftware/React.NET that referenced this issue Aug 12, 2018
dustinsoftware added a commit that referenced this issue Aug 12, 2018
* Fix JS engine reloading in .NET Core

Fixes #554

* Check environment before rewriting path

* Use Path.GetFullPath
Daniel15 pushed a commit that referenced this issue Aug 14, 2018
* Fix JS engine reloading in .NET Core

Fixes #554

* Check environment before rewriting path

* Use Path.GetFullPath
@dustinsoftware
Copy link
Member

Please update to 3.4.1 and let me know if the issue is resolved. @WonSong @knyzorg @LinusCenterstrom @benjamn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants