1

I have a Nuxt.js project to which I added just a few components for now. It runs flawlessly if build local. I wanted to test it on Heroku, however I get some webpack related build errors, in which I bury already 3 days.

remote:        ERROR in ./~/babel-loader/lib?{"plugins":["transform-async-to-generator","transform-runtime"],"presets":[["es2015",{"modules":false}],"stage-2"],"cacheDirectory":false}!./~/vue-loader/lib/selector.js?type=script&index=0!./layouts/default.vue
remote:        Module not found: Error: Can't resolve '../components/Sidebar/_Sidebar.vue' in '/tmp/build_fe4d2e874dff634cf8c7db3886460988/layouts'
remote:        @ ./~/babel-loader/lib?{"plugins":["transform-async-to-generator","transform-runtime"],"presets":[["es2015",{"modules":false}],"stage-2"],"cacheDirectory":false}!./~/vue-loader/lib/selector.js?type=script&index=0!./layouts/default.vue 30:0-57
remote:        @ ./layouts/default.vue
remote:        @ ./~/babel-loader/lib?{"plugins":["transform-async-to-generator","transform-runtime"],"presets":[["es2015",{"modules":false}],"stage-2"],"cacheDirectory":false}!./~/vue-loader/lib/selector.js?type=script&index=0!./.nuxt/App.vue
remote:        @ ./.nuxt/App.vue
remote:        @ ./.nuxt/index.js
remote:        @ ./.nuxt/server.js

I've also installed a fresh copy the nuxtjs.org starter theme but there is no error. It builds like charm.

This is my package.json

 {
      "name": "some-nuxt",
      "version": "0.3.0",
      "description": "nuxt-sandbox ",
      "private": true,
      "dependencies": {
        "axios": "^0.15.3",
        "nuxt": "^0.9.9",
        "vue-touch": "^2.0.0-beta.4"
      },
      "scripts": {
        "dev": "nuxt",
        "build": "nuxt build",
        "start": "nuxt start",
        "generate": "nuxt generate",
        "lint": "eslint --ext .js,.vue --ignore-path .gitignore .",
        "precommit": "npm run lint",
        "heroku-postbuild": "npm run build"
      },
      "devDependencies": {
        "ava": "^0.18.2",
        "babel-eslint": "^7.1.1",
        "eslint": "^3.16.0",
        "eslint-config-standard": "^6.2.1",
        "eslint-loader": "^1.6.1",
        "eslint-plugin-html": "^2.0.1",
        "eslint-plugin-promise": "^3.4.2",
        "eslint-plugin-standard": "^2.0.1",
        "jsdom": "^9.11.0",
        "node-sass": "^4.5.0",
        "sass-lint": "^1.10.2",
        "sass-loader": "^6.0.2"
      }
    }

This is some customisations from my nuxt.config.js file.

          css: [
            // '~assets/css/main.css',
            { src: '~assets/scss/app.scss', lang: 'sass' } // scss instead of sass
          ],
          ...
          alias: {
            'hammerjs$': 'vue-touch/dist/hammer-ssr.js'
          },
          build: {
            /*
            ** Run ESLINT on save
            */
            vendor: ['axios', 'vue-touch'],
            extend (config, { isClient }) {
              if (isClient) {
                config.module.rules.push({
                  enforce: 'pre',
                  test: /\.(js|vue)$/,
                  loader: 'eslint-loader',
                  exclude: /(node_modules)/
                })
              }
            }
          },
          plugins: ['~plugins/vue-touch']
        }
morten.c
  • 3,414
  • 5
  • 40
  • 45
Gökhan Özdemir
  • 320
  • 3
  • 11

2 Answers2

3

I found the reason that the case sensitive file system Linux of server of Heroku and insensitive system of mine are collided. When I renamed my sub components to uppercase, Github did not push the change to repo.

Neither npm run dev, nor npm run build has given any error in my computer. However when the Linux is looking for the exact names of the folder the problem occured.

This might be a precaution, working on a clean case sensitive formatted partition: https://coderwall.com/p/mgi8ja/case-sensitive-git-in-mac-os-x-like-a-pro

The title of the document explains the best. http://timnew.me/blog/2013/04/18/mac-os-x-case-insensitive-file-system-pitfall/

Gökhan Özdemir
  • 320
  • 3
  • 11
0

Adding up to what Gokhan Ozdemir's answer. I've faced a similar issue and realized I had changed a folder's name in a case-sensitive only way.

Example: from fonts to Fonts

It seems that it has to do with mac OS being a case insensitive environment.

I was able to solve it by following these steps:

 git mv fonts fonts2
 git mv fonts2 Fonts
 git commit -m "changed case of dir"

Notice that I had to change to fonts2 initially so that the case-sensitive renaming takes place effectively.

Here's the SO answer explaining the solution to this problem.