4

This is my first time building a Nuxt App and I'm trying to deploy it to netlify, now whats happening is I run

yarn run generate

I don't get any errors or anything but I get stuck here

Built at: 2019-02-01 15:16:38
                  Asset       Size  Chunks             Chunk Names
53deff7cce1c2de4cfa5.js     59 KiB       1  [emitted]  pages_index
              server.js   36.9 KiB       0  [emitted]  app
   server.manifest.json  243 bytes          [emitted]
 + 2 hidden assets
Entrypoint app = server.js server.js.map
i Generating pages                                                                              
15:16:38
√ Generated /                                                                                   

and then nothing?

The same thing happens when I run the command in my terminal, It just stays on generated and nothing happens

My site is pretty basic and I have not added any other config excpet for the ability to use scss

My site is never deployed Its been sitting like that for an hour is there something I'm doing wrong??

EDIT

Finally something happened

Build exceeded maximum allowed runtime

How can I solve this issue??

Any help would be appreciated!

2 Answers 2

4

Edit: The solution is to wrap any setInterval calls with if (process.client) { /* ... */ }, so the code is only executed in client side. This way, the Nuxt generator can safely render the components without hanging.

This is actually happening to me, too. Perhaps you have a setInterval call somewhere in your components? It stopped hanging on generate after removing it...

I guess the reason is that when Nuxt starts generating the static pages, it actually runs and renders the Vue components, so the intervals keep the process alive.

Sign up to request clarification or add additional context in comments.

7 Comments

...omg I do have a setInterval call in two of my components! Is there anyway around this whilst still keeping the intervals?
the main thing to keep in mind is that Netlify's CD environment needs your build process to not only finish (return you to the prompt) but also and harder to debug ALL PROCESSES STARTED DURING BUILD MUST EXIT! Processes like a browser-sync that would watch the build directory and reload a page in your browser don't make sense in Netlify's build env - but you can run them, and they can block Netlify's system from realizing your build is finished. So - that's the goal - all processes exit, and the main one exits with status 0 so Netlify knows the build was a success.
@SmokeyDawson yeah, I just edited the answer! Just use process.client to ensure that the intervals are only ran on the client side.
Does that apply to setTimeout too? I do not have setInterval anywhere in my code but I do have setTimeout. I am stuck with Building Nitro Server.
@JovanniG I guess... I suggest doing a quick test by removing your timeouts and trying to build it.
|
0

In addition to the setInterval calls in the accepted answer, this can also happen if you have any other asynchronous code that will get evaluated at build time. For me that was an await inside one of my plugin files, that wasn't ever getting completed.

Wrapping it in an if (process.client) {} to make sure it doesn't run at build time fixed it for me.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.