Npm run Generate to debug doesn't work

Hi everybody!

I want to generate my website on staging, and i need to use Vue.js devtools.
I tried to add an Environment variable NODE_ENV : development and i modified the Build command from npm run generate to npm run dev.

But the build isn’t working (no message, no error), it never stops.

Any ideas?

Thanks a lot!

can you please post your package.json and a recent deploy log?

Hi perry.

{
  "name": "silvain",
  "version": "1.0.0",
  "private": true,
  "scripts": {
    "dev": "nuxt",
    "build": "nuxt build",
    "start": "nuxt start",
    "generate": "nuxt generate"
  },
  "dependencies": {
    "@nuxtjs/auth-next": "5.0.0-1648802546.c9880dc",
    "@nuxtjs/axios": "^5.13.6",
    "@nuxtjs/pwa": "^3.3.5",
    "bootstrap": "^4.6.1",
    "bootstrap-vue": "^2.21.2",
    "core-js": "^3.19.3",
    "nuxt": "^2.15.8",
    "vue": "^2.6.14",
    "vue-server-renderer": "^2.6.14",
    "vue-template-compiler": "^2.6.14",
    "webpack": "^4.46.0"
  },
  "devDependencies": {
    "fibers": "^5.0.1",
    "sass": "^1.49.0",
    "sass-loader": "^10"
  }
}

For the build, maybe it’s normal:

And in the deploy list:

Product: staging@HEAD Building

Hey @pit07

I can see from the screenshot you have used npm run dev instead of npm run generate which you eluded to using in the title of this thread.

Try changing the build command to npm run generate.

Check out the Nuxt Netlify deploy documentation

Also the Netlify Nuxt deploy documentation

Hi Coelmay!

Indeed, i changed generate by dev.
I try to use Vue.js DevTools (on Chrome) to debug my authentication on staging environment.

I was told to change the building command with npm run dev, and to add the environment var NODE_ENV: development in the Environment variables panel

image

But it doesn’t work :frowning:

npm run dev will work for you locally. Have you tried that?

Yes, locally, it’s working.
But i need to have a dev environment on staging to debug :frowning:

Using NODE_ENV="development" will work on Netlify. Using npm run dev won’t.

You can do a development build e.g. NODE_ENV="development" npm run generate.

Maybe it’s a problem with devtools vue.js :frowning:
It doesn’t appear in my chrome inspector

What is the exact issue you are facing?

What is the site you are seeing these issues on?

1 Like

https://staging.nougats-silvain.fr/mon-compte/login/

The API seems to be OK but the $auth.user is empty.
I was advised to use devTools Vue.Js to get more information, but I can’t get it to work on staging.

Did you try adding some console.log() statements? Or using Chrome debugger?

You can do something like:

fetch().then(() => {
  debugger
})

If you’ve Chrome developer tools open, this keyword will add a breakpoint allowing you to debug your variables and data.