You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ssr:serveNPM script doesn't work with Vue 2 & TypeScript app created with Vue CLI.
Reproduction steps
Create a new Vue (2.x) app with TS support, using the Vue CLI:
Run the following command: vue create vue2-uvue:
Please pick a preset: Manually select features.
Check the features needed for your project::
Choose Vue version
Babel
TypeScript
Choose a version of Vue.js that you want to start the project with: 2.x.
Use class-style component syntax? Yes.
Use Babel alongside TypeScript? Yes.
Where do you prefer placing config for Babel, ESLint, etc.? In dedicated config files.
Save this as a preset for future projects? No.
Check if the app has been bootstrapped successfully:
Run the following command: npm run serve.
Expected output: DONE Compiled successfully in Xms \n No type errors found \n Version: typescript 3.9.9 \n Time: Xms \n App running at: \n - Local: http://localhost:8080/ \n - Network: http://192.168.X.X:8080/ \n Note that the development build is not optimized. To create a production build, run npm run build.
Expected state of the browser when asked to open http://localhost:8080/:
Add Universal Vue to the project
Run the following command: vue add @uvue/ssr:
Install UVue plugins?
Async Data method
Middleware system
Error handler
Install server plugins?
GZIP compression
Server error page
Static files serving
Modern build
Do you want to use Docker to deploy your app? No.
Expected output: DONE ssr \n UVue installed, please read this before starting: \n https://universal-vue.github.io/docs/guide/post-install.html#post-installation-notes
Check if the UVue has been installed successfully:
DONE
Compiled successfully in XXXms
Server is running: http://localhost:8080
Type "rs" to restart server
No type errors found
Version: typescript 3.9.9
Time: XXms
After asked to open the URL http://localhost:8080/, the browser should look exactly the same as it looks after running the command npm run serve.
Actual behavior
The browser can't locate the server/resources/whatever we're asking it for:
Google Chrome Dev:
Firefox Developer Edition:
Sizzy:
Additional thoughts
The npm run serve command still works fine and produces the correct output.
There's no problem with UVue when we run the following command: npm run ssr:build && npm run ssr:start.
If, in the reproduction step 1.i.b (1.1.2) we do NOT select TypeScript, then UVue and ssr:serve script work just fine.
Additional context
Please indicate versions of:
node: v14.15.1
npm: 7.5.4
vue-cli: @vue/cli 4.5.11
uvue:
@uvue/core: 0.1.7
@uvue/server: 0.1.7
@uvue/vue-cli-plugin-ssr: 0.1.7
@uvue/rquery: 0.1.7
OS: macOS Big Sur 11.2.2 (20D80)
Browser:
Google Chrome Dev: 90.0.4427.5
Firefox Developer Edition: 90.0.4427.5
Sizzy: 51.0.0
The text was updated successfully, but these errors were encountered:
Strange as heck, but my exhaustive research on this problem showed that running either rm -rf ./node-modules && rm ./package-lock.json && npm installornpm update solves the problem every single time.
More than 4 hours of digging through the source code and I found a solution by accident... Would love to know which exact package causes this problem but the diff log is too long for me, sorry 😃
Description
ssr:serve
NPM script doesn't work with Vue 2 & TypeScript app created with Vue CLI.Reproduction steps
vue create vue2-uvue
:npm run serve
.DONE Compiled successfully in Xms \n No type errors found \n Version: typescript 3.9.9 \n Time: Xms \n App running at: \n - Local: http://localhost:8080/ \n - Network: http://192.168.X.X:8080/ \n Note that the development build is not optimized. To create a production build, run npm run build.
http://localhost:8080/
:vue add @uvue/ssr
:DONE ssr \n UVue installed, please read this before starting: \n https://universal-vue.github.io/docs/guide/post-install.html#post-installation-notes
npm run ssr:serve
.Reproduction repository
Expected behavior
Console should produce following output:
After asked to open the URL
http://localhost:8080/
, the browser should look exactly the same as it looks after running the commandnpm run serve
.Actual behavior
The browser can't locate the server/resources/whatever we're asking it for:
Additional thoughts
npm run serve
command still works fine and produces the correct output.npm run ssr:build && npm run ssr:start
.ssr:serve
script work just fine.Additional context
Please indicate versions of:
The text was updated successfully, but these errors were encountered: