-
-
Notifications
You must be signed in to change notification settings - Fork 529
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
window
is not defined in worker file
#97
Comments
with vue-cli v3 there is none, and // vue.config.js
module.exports = {
css: {
loaderOptions: {
// pass options to sass-loader
sass: {
// @/ is an alias to src/
// so this assumes you have a file named `src/variables.scss`
data: `@import "@/styles/_variables.scss"; @import "@/styles/_mixins.scss";`
}
}
},
configureWebpack: {
output: {
globalObject: 'this' // `typeof self !== 'undefined' ? self : this`'' -- not working
}
}
} |
If you end up here via the Quasar framework, you can use chainWebpack in your quasar.conf.js: build: {
chainWebpack(chain) {
chain.output.set('globalObject', 'this') |
In Nuxt, you can get this to work in extend(config, ctx) {
config.output.globalObject = 'this'
} |
This comment has been minimized.
This comment has been minimized.
Make sure you also add plugins: [
{ src: '@/plugins/pdf', ssr: false },
] |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Still waiting |
This comment has been minimized.
This comment has been minimized.
this saved me :D , thank you @coreycoburn |
Working solution on this link #148 |
Solve this issue for nuxt.js |
This is not really an issue with vue-pdf but I ran into this recently and tought it may be worth sharing.
When using vue-pdf with Webpack 4 (e.g. a project created by vue-cli v3) the dev build with hot reloading gave the following error message:
and vue-pdf did not display anything.
This only occurs on development builds with hot reloading, on production it is fine.
After investigating I found the following issue to be the reason why this happens: webpack/webpack#6642
Until this is fixed in webpack the following workaround did work for me.
In the Webpack config set the following option:
The text was updated successfully, but these errors were encountered: