-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
Running SSR Server does not work with Typescript #57
Comments
Can you provide a demo repo or a sandbox with your code in it so that I can get a closer look at the issue you have? I already have an SSR app with this plugin and TS and it works like charm. Thanks |
@p1n5u please, check, is your version exactly 0.5.0 or older indeed? I've met the same weird stuff, and all's charm without TS after upgrade. |
@houd1ni It was running on |
I have a similar situation - plugin is broken after |
Thanks for the help narrowing down the issue. I'll try to use an older version in the mean time. |
In my case I see the following: ✔ success Client compiled in 987ms
Type checking in progress...
Client errors
multi webpack-hot-middleware/client ./src/main.ts
Module not found: Error: Can't resolve './src/main.ts' in '/Users/yekver/app' this is because my entry point is |
I have same problem and downgrade don't fix it |
@ilajosmanov Should be ok if clearly downgrade to 0.3.0 |
@houd1ni awesome, it's works )) |
@houd1ni I tried installing it with |
@alexey-yunoshev Looks like off-topic, but I afraid, you just mistyped "vue add @akryum/vue-cli-plugin-ssr@0.3.0". |
@houd1ni I tried it with Update: To make it work I had to do this: Also, when starting a server with
In order to fix this I changed import "./registerServiceWorker';" to "if (process.client) require("./registerServiceWorker");" in main.ts. Got the idea from here |
Did someone find the difference responsible of this? I will give a try to downgrading 🤔 |
I can also confirm 0.3.0 works fine but 0.5.0 causes errors. |
@houd1ni Does v0.3.0 has a hook to add or update files such as entry-client, entry-server and so on? I added v0.3.0 but there were no files added or updated. |
I've managed to come up with a solution. This whole Vue CLI + webpack configuration topic could be even better documented than it already is... The thing with the changes in a4ee8e4 is, that the plugin is adopting the "new" What's bad is that by default the |
amazing detective work @nether-cat. Can confirm that this solution worked for me too! Seems like there should be a way for vue-cli to let you specify the order of plugins when the order matters |
Plugin ordering is on our radar for v4 |
For anyone having trouble to understand the "change the alphabetical order" (like me), thinking that is something "complex" and isn't understanding it correctly... All you have to do is to change the order in the package.json (putting "@akryum/vue-cli-plugin-ssr" after "@vue/cli-plugin-typescript"), and it works as expected. Thank you so much @nether-cat !!! 👍 |
Instead of moving the
But it's likely to run twice. Another solution is to add the plugin to the argument
|
Is there a good long term fix for this in latest Vue CLI or something? I'm having this problem and none of the solutions seem super ideal. |
Also interested by a proper fix to benefit from latest versions features 😄 |
I'm evaluating this plugin to use with a Vue-CLI project created with Typescript.
Repro steps:
vue create new-project
vue add @vue/typescript
vue add @akryum/ssr
npm run ssr:serve
Result: When opening localhost:8000, I get an error from the server on initial render:
TypeError: runner is not a function
.Expected Result: Example app renders as expected.
Let me know if this is on the radar already? I'm pretty interested in this project so I would be happy to attempt to contribute a solution to this issue.
demo repo: https://github.com/hmillison/vue-ssr-plugin-reproduction.git
The text was updated successfully, but these errors were encountered: