`window` is not defined when using with webpack
See original GitHub issueHello! I’m trying to use clooney with webpack + lit-html, but I’m keep getting errors.
It appears that clooney is executing lit-html stuff in a web worker, even if lit-html is not being used in the class spawned by clooney. My tsconfig.json
are targeting es2017, so that’s not the problem.
Here is my webpack config (using webpack-serve): webpack.dev.js. And the file where clooney is being used: video_card.view.ts. All the code to reproduce the issue is available at my repo: youtube-collection.
Clone the repo and run yarn && yarn serve
.
Thanks for your amazing work.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Window is not defined after a build with Webpack
js it gives me this error: ReferenceError: window is not defined. const webpack = require('webpack'); const merge = require('webpack-merge'); ...
Read more >[SOLVED] Webpack: Error in window is not defined during ...
js file during deploy. I am not using "window" in my code and node_modules using it are all necessary so i have to...
Read more >Window is not defined after a build with Webpack-Reactjs
Using global worked for me. const window = global.window if (window && window.localStorage) { const storageLogLevel = window.localStorage.
Read more >Gatsby - the window is not defined error, what and how to fix it?
How to fix the 'window not defined' error? · Check if window is defined · Using useEffect hook or componentDidMount method · Handling...
Read more >Implement workaround / fix for webpack's "window is not ...
Implement workaround / fix for webpack's "window is not defined" ... globalObject is bound to window , should probably be bound to this...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@woitechen I apologize for not getting you examples in time but I appreciate you following up with the solution you found. I think that will be even cleaner than my approach so I’m definitely going to steal it. Thanks.
@adammedford Would you be able to share your solution to make clooney play nicely with Angular CLI? Followed the official docs, but no go. Same error as this issue.