Skip to content

Error in SSR (vue cli 3.0) #58

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
daniel-xyz opened this issue Jan 15, 2019 · 3 comments
Closed

Error in SSR (vue cli 3.0) #58

daniel-xyz opened this issue Jan 15, 2019 · 3 comments

Comments

@daniel-xyz
Copy link

daniel-xyz commented Jan 15, 2019

Hey, maybe you could give me a hint about what I'm doing wrong.. The client code works, but every time the app is rendered by the server (Vue with createBundleRenderer), I get this error:

error during render : /
/Users/daniel/Library/Mobile Documents/com~apple~CloudDocs/Projects/Repos/vue-cli-ssr-example/node_modules/@ionic/core/css/ionic.bundle.css:1
(function (exports, require, module, __filename, __dirname) { html.ios{--ion-default-font:-apple-system,BlinkMacSystemFont,"Helvetica Neue","Roboto",sans-serif}html.md{--ion-default-font:"Roboto","Helvetica Neue
",sans-serif}html{--ion-font-family:var(--ion-default-font)}body.backdrop-no-scroll{overflow:hidden}.ion-color-primary{--ion-color-base:var(--ion-color-primary, #3880ff)!important;--ion-color-base-rgb:var(--ion-
color-primary-rgb, 56,128,255)!important;--ion-color-contrast:var(--ion-color-primary-contrast, #fff)!important;--ion-color-contrast-rgb:var(--ion-color-primary-contrast-rgb, 255,255,255)!important;--ion-color-s
hade:var(--ion-color-primary-shade, #3171e0)!important;--ion-color-tint:var(--ion-color-primary-tint, #4c8dff)!important}.ion-color-secondary{--ion-color-base:var(--ion-color-secondary, #0cd1e8)!important;--ion-
color-base-rgb:var(--ion-color-secon

SyntaxError: Unexpected token {
    at new Script (vm.js:79:7)
    at createScript (vm.js:251:10)
    at Object.runInThisContext (vm.js:303:10)
    at Module._compile (internal/modules/cjs/loader.js:657:28)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)

I'm using the same vue.config.js as here: https://github.com/eddyerburgh/vue-cli-ssr-example/blob/master/vue.config.js

The other parts of the projects are also still exactly like in this repo.

Thanks in advance!

@michaeltintiuc
Copy link
Member

Looks like the content of (function (exports, require, module, __filename, __dirname) is plain CSS, which explains the syntax error, as far as I know ionic 4 isn't ready for SSR yet, but it's best if you confirm it with them.

@daniel-xyz
Copy link
Author

SSR doesn't seem ready yet, even for Angular: ionic-team/ionic-framework#15041

I wonder if there is a workaround that is worth going forward with (e.g. with https://github.com/skatejs/ssr). Would be so nice if someone could share his/her experiences! :)

@michaeltintiuc
Copy link
Member

I'll be closing this as not related to ionic-vue, but if you don't mind, keep us informed on your findings!

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

2 participants