question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`window` is not defined when using with webpack

See original GitHub issue

Hello! I’m trying to use clooney with webpack + lit-html, but I’m keep getting errors.

image

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:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

1reaction
adammedfordcommented, Oct 30, 2018

@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.

0reactions
rosslaverycommented, Aug 14, 2019

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found