0

I'm building a nuxt site in VS Code, which works fine on localhost:3000. It's set up as a universal app in nuxt.config.js - but when I run npm run generate to create the distribution files to upload to my actual webhost, I'm getting an error that prevents.

Tried rebuilding a fresh site - and using the default nuxt site without any modifications, the npm run generate process works fine and I can successfully get things running on my webhost.

Tried bringing my page files, json file and config file into the fresh site - and once again got things running properly on localhost:3000. But when i try do generate the distribution files, I get the same error.

Here's what I get after doing npm run generate

PS D:\Users\Robert\Documents\WEBSITES\nuxt\d8vue> npm run generate

> d8vue@1.0.0 generate D:\Users\Robert\Documents\WEBSITES\nuxt\d8vue
> nuxt generate

i Production build                                                                                                    13:47:31
√ Builder initialized                                                                                                 13:47:31
√ Nuxt files generated                                                                                                13:47:31

√ Client
  Compiled successfully in 8.49s

√ Server
  Compiled successfully in 2.30s


Hash: 3cb6ba5253c0229b1fc0
Version: webpack 4.39.1
Time: 8492ms
Built at: 08/08/2019 1:47:42 PM
                         Asset      Size  Chunks             Chunk Names
../server/client.manifest.json  8.32 KiB          [emitted]
       18b77c96eefb8a10c43a.js  15.2 KiB       2  [emitted]  commons.pages_index
       44cf40050484c4128f83.js   144 KiB       3  [emitted]  pages_index
                      LICENSES  3.84 KiB          [emitted]
       afd3e3642b1be8ea332c.js   199 KiB       5  [emitted]  vendors.pages_index
       bc62accdb31256545d41.js   146 KiB       1  [emitted]  commons.app
       c527b02f54c94dfbbeb4.js  40.7 KiB       0  [emitted]  app
       efe80b1f2f97417159c9.js  2.35 KiB       4  [emitted]  runtime
 + 2 hidden assets
Entrypoint app = efe80b1f2f97417159c9.js bc62accdb31256545d41.js c527b02f54c94dfbbeb4.js

Hash: 686851517fd942241de0
Version: webpack 4.39.1
Time: 2298ms
Built at: 08/08/2019 1:47:44 PM
                  Asset       Size  Chunks             Chunk Names
b0a24a811505a689c203.js   48.8 KiB       1  [emitted]  pages_index
              server.js   24.8 KiB       0  [emitted]  app
   server.manifest.json  243 bytes          [emitted]
 + 2 hidden assets
Entrypoint app = server.js server.js.map
i Generating pages                                                                                                    13:47:44

 ERROR   /                                                                                                            13:47:44

TypeError: Cannot read property 'defaultView' of undefined
    at b0a24a811505a689c203.js:2:455
    at Object.24 (b0a24a811505a689c203.js:1:0)
    at r (server.js:1:0)
    at Module.32 (b0a24a811505a689c203.js:1:0)
    at r (server.js:1:0)
    at async server.js:1:7975
    at async Promise.all (index 0)
    at async y (server.js:1:0)
    at async Promise.all (index 0)
    at async v (server.js:1:0)
    at async W (server.js:1:0)
    at async e.default (server.js:1:0)

Expected to get a complete dist folder for upload - but not all of the files were generated

Rob
  • 1
  • The error is `Cannot read property 'defaultView' of undefined` as nuxt tries to generate you pages. Therefore one of your pages is trying to use `something.defaultView` and that something doesn't exist. You'll need to look in your various pages code and find this. – Andrew1325 Aug 09 '19 at 08:19
  • Hey @Andrew1325 - thank you for that tip. I wasn't sure what to do with that error message, but after reading your post, I seach for 'defaultView' and tracked the problem down to a group of related plugins causing the error. Trying to troubleshoot that now with people familiar with that platform. Thanks so much for pointing me in the right direction. – Rob Aug 10 '19 at 21:08

0 Answers0