-
Notifications
You must be signed in to change notification settings - Fork 52
btoa in css source break SSR #88
Comments
Just a +1, having the same issue when rolling a Vue component with the following rollup-plugin-vue config. Backtracked the btoa-issue to the vue-component-compiler. (using the following config)
|
i have the same issue |
I'm facing the same issue (with rollup), did any of you find a workaround ? Thanks |
The precise error is: It looks like the following solution from StackOverflow can be applied in the case that the runtime is Node.js I tested the following change locally if (typeof boa === 'undefined') {
code += '\n/*# sourceMappingURL=data:application/json;base64,' + Buffer.from(unescape(encodeURIComponent(JSON.stringify(css.map))), 'binary').toString('base64') + ' */';
} else {
code += '\n/*# sourceMappingURL=data:application/json;base64,' + btoa(unescape(encodeURIComponent(JSON.stringify(css.map)))) + ' */';
} Unfortunately, this is far from the only place the assembler assumes it's running in a browser. |
Are there any updates around this? It's absolutely killing us :( |
Run into the same problem and it's almost killing me :( |
This line
https://github.com/vuejs/vue-component-compiler/blob/master/src/assembler.ts#L116
breaks SSR because btoa is not available in the global namespace of node.
If you add a check here, SSR will work.
The text was updated successfully, but these errors were encountered: