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

See original GitHub issue

repo

https://github.com/calibur-tv/arthur

step

clone repo
yarn install
yarn workspace core build

error message

yarn workspace core build

[vite-ssg] Build for client...
vite v2.0.2 building for production...
✓ 18 modules transformed.
dist/index.html                  0.47kb
dist/ssr-manifest.json           1.45kb
dist/assets/index.84deefdb.js    0.14kb / brotli: 0.11kb
dist/assets/about.b281ebe7.js    0.14kb / brotli: 0.10kb
dist/assets/app.63e62a7a.css     0.16kb / brotli: 0.10kb
dist/assets/app.6e05f1be.js      2.13kb / brotli: 1.01kb
dist/assets/vendor.a9bc8345.js   68.26kb / brotli: 23.85kb

[vite-ssg] Build for server...
vite v2.0.2 building SSR bundle for production...
✓ 6 modules transformed.
.vite-ssg-temp/main.js                     4.08kb
.vite-ssg-temp/assets/style.20813ca4.css   0.20kb
ReferenceError: window is not defined
    at useHistoryStateNavigation (/Users/yuistack/Documents/calibur/arthur/node_modules/vue-router/dist/vue-router.cjs.js:501:35)
    at Object.createWebHistory (/Users/yuistack/Documents/calibur/arthur/node_modules/vue-router/dist/vue-router.cjs.js:593:31)
    at Module.<anonymous> (/Users/yuistack/Documents/calibur/arthur/packages/core/.vite-ssg-temp/main.js:65:22)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at build (/Users/yuistack/Documents/calibur/arthur/node_modules/vite-ssg/dist/node/cli.js:134:23)

system info

  • node:v14.15.1

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

0reactions
anhzfcommented, Jul 2, 2021

@anhzf see #21 (comment)

thanks, but the problem is solved. it is because I’m trying to using web history on routeOptions even though the default of vite-ssg is using web history

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve "window is not defined" errors in React and Next.js
Because in the Node.js world, window is not defined, window is only available in browsers. There are three ways to solve that: 1....
Read more >
How to solve Next.js window is not defined
ReferenceError : window is not defined is a pretty common error you may run into when using Next.js for the first time but...
Read more >
Javascript: 'window' is not defined - Stack Overflow
The window object represents an open window in a browser. Since you are not running your code within a browser, but via Windows...
Read more >
referenceerror: window is not defined, how to solve
Here's how to fix the “referenceerror: window is not defined” error that you might have in Node.js or with a tool like Next.js....
Read more >
How To Solve ReferenceError window is not defined in ...
Fixing a window is not defined error can be quite simple. In most cases, all you will need to do is wrap your...
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