9

I'm trying to deploy my nuxt js project to netlify. The installation part works fine, But it returns an error in the build process.

I tried to search google but I can't find any solution to this problem.

I also tried this command CI= npm run generate

3:16:42 PM: $ npm run generate
3:16:43 PM: > [email protected] generate
3:16:43 PM: > nuxt generate
3:16:50 PM: node: ../src/coroutine.cc:134: void* find_thread_id_key(void*): Assertion `thread_id_key != 0x7777' failed.
Aborted
3:16:50 PM: ​
3:16:50 PM: ────────────────────────────────────────────────────────────────
3:16:50 PM:   "build.command" failed                                        
3:16:50 PM: ────────────────────────────────────────────────────────────────
3:16:50 PM: ​
3:16:50 PM:   Error message
3:16:50 PM:   Command failed with exit code 134: npm run generate
3:16:50 PM: ​
3:16:50 PM:   Error location
3:16:50 PM:   In Build command from Netlify app:
3:16:50 PM:   npm run generate
3:16:50 PM: ​
3:16:50 PM:   Resolved config
3:16:50 PM:   build:
3:16:50 PM:     command: npm run generate
3:16:50 PM:     commandOrigin: ui
3:16:50 PM:     publish: /opt/build/repo/dist
3:16:50 PM:     publishOrigin: ui
3:16:50 PM: Caching artifacts
3:16:50 PM: Started saving node modules
3:16:50 PM: Finished saving node modules
3:16:50 PM: Started saving build plugins
3:16:50 PM: Finished saving build plugins
3:16:50 PM: Started saving pip cache
3:16:50 PM: Finished saving pip cache
3:16:50 PM: Started saving emacs cask dependencies
3:16:50 PM: Finished saving emacs cask dependencies
3:16:50 PM: Started saving maven dependencies
3:16:50 PM: Finished saving maven dependencies
3:16:50 PM: Started saving boot dependencies
3:16:50 PM: Finished saving boot dependencies
3:16:50 PM: Started saving rust rustup cache
3:16:50 PM: Finished saving rust rustup cache
3:16:50 PM: Started saving go dependencies
3:16:50 PM: Finished saving go dependencies
3:16:52 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
3:16:52 PM: Creating deploy upload records
3:16:52 PM: Failing build: Failed to build site
3:16:52 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
3:16:52 PM: Finished processing build request in 1m34.230804646s

Here is the Nuxt Config - My target is to build a static site. You may guess this is my portfolio site. I'm working on my portfolio to get a better job.

nuxt.config.js

export default {
  // Target: https://go.nuxtjs.dev/config-target
  target: 'static',

  // Global page headers: https://go.nuxtjs.dev/config-head
  head: {
    title: 'Hasibur',
    htmlAttrs: {
      lang: 'en'
    },
    meta: [
      { charset: 'utf-8' },
      { name: 'viewport', content: 'width=device-width, initial-scale=1' },
      { hid: 'description', name: 'description', content: '' },
      { name: 'format-detection', content: 'telephone=no' }
    ],
    link: [
      { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }
    ]
  },

  // Global CSS: https://go.nuxtjs.dev/config-css
  css: [
    '@/assets/scss/main.scss'
  ],

  // Plugins to run before rendering page: https://go.nuxtjs.dev/config-plugins
  plugins: [
    { src: '~/plugins/components.js', mode: 'client' },
    { src: '~/plugins/fontawesome.js', mode: 'client' },
  ],

  // Auto import components: https://go.nuxtjs.dev/config-components
  components: true,

  // Modules for dev and build (recommended): https://go.nuxtjs.dev/config-modules
  buildModules: [
    // https://go.nuxtjs.dev/tailwindcss
    '@nuxtjs/tailwindcss',
  ],

  // Modules: https://go.nuxtjs.dev/config-modules
  modules: [
    // https://go.nuxtjs.dev/axios
    '@nuxtjs/axios',
  ],

  // Axios module configuration: https://go.nuxtjs.dev/config-axios
  axios: {},

  // Build Configuration: https://go.nuxtjs.dev/config-build
  build: {
  }
}

4
  • Does it work locally? Also, can you please share your nuxt.config.js file? Also, do you know what is coroutine.cc? Commented Nov 11, 2021 at 9:54
  • Yes, It works locally very well. And I don't know this file coroutine.cc . Commented Nov 11, 2021 at 18:00
  • What if you generate your project and then, upload your /dist directory on app.netlify.com/drop? Commented Nov 11, 2021 at 20:36
  • The problem was ```fibers````. Thanks Commented Nov 12, 2021 at 6:56

1 Answer 1

8

I just had the same problem and solved it thanks to this question. The problem seems to be fibers.

The steps I took to fix it:

  1. uninstall fibers: npm uninstall fibers
  2. delete package-lock.json & node_modules/
  3. install packages again: npm install

Simply removing fibers from package.json isn't enough as Netlify seems to still find the package in package-lock.json.

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

2 Comments

But I have to use fibers because I'm using sass and sass-loader. Nuxt required to use fibers when you need sass
Nuxt doesn't require it, they just recommended it since it improved build time. When you look in the docs now, they actually don't mention it anymore.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.