-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
bundleRenderer fails when the application and the vue-server-renderer are in different modules/packages #4936
Comments
This is a reply to a removed comment, that suggested not externalizing dependencies. That's correct, see
|
I don't exactly understand what you are expecting ... How should you app know that the dependencies of the server bundle that you loaded should not be looked up in the local |
@LinusBorg my expectation is that |
(emphasis mine) You currently don't bundle anything, and instead simply require the unbundled code as if it was a normal |
Not really, if you take a look at app/lib/server-bundle.js - it's bundled with webpack. The webpack configuration is also in the repository app/webpack.config.js and you can re-bundle by running |
@LinusBorg can you reproduce the issue ? |
This is expected behavior. First because of the Is there any particular reason you have to structure your project this way? |
Ah! Sorry. But, you excluded all dependencies, which brings us back to my original point, to which you replied:
Well, for that, node /which will require the dependencies that you externalized during build of the bundle) has to know about that path. https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders |
This has nothing to do with global folders, the typical node behavior is that |
@yyx990803 the typical use case is decoupling the web server (with ssr) from the application. One dirty workaround, is monkey patching the |
I was linking to the section about global modules for NODE_PATH as a possible workaround/solution. |
Added the Maybe something like node-resolve in the sandbox ? |
@yyx990803 thank you! |
node_path环境变量配好就行了? |
This is my first issue, so before anything else - thanks to @yyx990803 and Vue community for awesome work!
Vue.js version
2.0.2
Reproduction Link
https://github.com/abc/vueSSRTest
Steps to reproduce
This works as expected
This fails
What is Expected?
vue-server-renderer's bundleRenderer is expected to execute the pre-bundled application successfully, even when the application is in a separate module/package.
What is actually happening?
vue-server-renderer's bundleRenderer fails to execute the pre-bundled application when the application and the vue-server-renderer are in different packages.
The text was updated successfully, but these errors were encountered: