websemantics / strong-together

A starter project to build single page Vue.js apps as stand-alone or for Laravel / Laravel Spark projects; based on Browserify and Semantic-UI.
http://websemantics.github.io/strong-together
MIT License
89 stars 18 forks source link

npm run build error: "Elixir.ready is not a function" #2

Closed huntercarter closed 6 years ago

huntercarter commented 7 years ago

npm install returns

Create semantic-ui theme config file @ node_modules/semantic-ui-less/theme.config
All done

however, npm run build returns

.../laravel-elixir-vueify/index.js:3
Elixir.ready(() => {
       ^

TypeError: Elixir.ready is not a function

    at Object.<anonymous> (.../laravel-elixir-vueify/index.js:3:8)
    at Module._compile (module.js:573:32)
    at Object.Module._extensions..js (module.js:582:10)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (.../gulpfile.js:4:14)
    at Module._compile (module.js:573:32)
Shuliyey commented 6 years ago

I did a bit digging into this, this is what i found

package.json change the dependency to

  "dependencies": {
    "vue": "^1.0.0"
  },
  "devDependencies": {
    "base-64": "^0.1.0",
    "bragit": "*",
    "gitters": "^1.0.6",
    "gulp": "^3.8.8",
    "jquery": "^2.1.4",
    "laravel-elixir": "^6.0.0-15",
    "laravel-elixir-browserify-official": "^0.1.3",
    "laravel-elixir-vueify": "^2.0.0",
    "larder": "^1.0.2",
    "nodemon": "*",
    "semantic-ui-less": "^2.2.12",
    "vue-resource": "^0.7.0",
    "vue-router": "^0.7.13"
  }

gulpfile.js change to

var elixir = require('laravel-elixir')
             require('laravel-elixir-browserify-official')
             require('laravel-elixir-vueify');

result

| => gulp
[22:27:55] Using gulpfile ~/Documents/node/strong-together/gulpfile.js
[22:27:55] Starting 'all'...
[22:27:55] Starting 'scripts'...
[22:27:56] Finished 'scripts' after 141 ms
[22:27:56] Starting 'less'...
[22:28:05] Finished 'less' after 9.82 s
[22:28:05] Starting 'browserify'...
[22:28:08] Finished 'browserify' after 2.58 s
[22:28:08] Starting 'copy'...
[22:28:08] Finished 'copy' after 5.41 ms
[22:28:08] Starting 'copy'...
[22:28:08] Finished 'copy' after 16 ms
[22:28:08] Starting 'copy'...
[22:28:08] Finished 'copy' after 44 ms
[22:28:08] Starting 'copy'...
[22:28:08] Finished 'copy' after 21 ms
[22:28:08] Starting 'styles'...
[22:28:08] Finished 'styles' after 30 ms
[22:28:08] Finished 'all' after 13 s
[22:28:08] Starting 'default'...
┌──────────────────┬──────────────────────────┬───────────────────────────────────────────────────────────────────┬────────────────────────┐
│ Task             │ Summary                  │ Source Files                                                      │ Destination            │
├──────────────────┼──────────────────────────┼───────────────────────────────────────────────────────────────────┼────────────────────────┤
│ mix.scripts()    │ 1. Concatenating Files   │ node_modules/jquery/dist/jquery.js                                │ public/js/all.js       │
│                  │ 2. Writing Source Maps   │ node_modules/semantic-ui-less/definitions/behaviors/visibility.js │                        │
│                  │ 3. Saving to Destination │ node_modules/semantic-ui-less/definitions/modules/sidebar.js      │                        │
│                  │                          │ node_modules/semantic-ui-less/definitions/modules/transition.js   │                        │
├──────────────────┼──────────────────────────┼───────────────────────────────────────────────────────────────────┼────────────────────────┤
│ mix.less()       │ 1. Compiling Less        │ resources/assets/less/app.less                                    │ public/css/app.css     │
│                  │ 2. Autoprefixing CSS     │                                                                   │                        │
│                  │ 3. Concatenating Files   │                                                                   │                        │
│                  │ 4. Writing Source Maps   │                                                                   │                        │
│                  │ 5. Saving to Destination │                                                                   │                        │
├──────────────────┼──────────────────────────┼───────────────────────────────────────────────────────────────────┼────────────────────────┤
│ mix.browserify() │                          │ resources/assets/js/app.js                                        │ public/js/app.js       │
├──────────────────┼──────────────────────────┼───────────────────────────────────────────────────────────────────┼────────────────────────┤
│ mix.copy()       │ 1. Saving to Destination │ resources/assets/views/index.html                                 │ public/index.html      │
├──────────────────┼──────────────────────────┼───────────────────────────────────────────────────────────────────┼────────────────────────┤
│ mix.copy()       │ 1. Saving to Destination │ resources/assets/img/**/*                                         │ public/img             │
├──────────────────┼──────────────────────────┼───────────────────────────────────────────────────────────────────┼────────────────────────┤
│ mix.copy()       │ 1. Saving to Destination │ resources/assets/fonts/**/*                                       │ public/fonts/roboto    │
├──────────────────┼──────────────────────────┼───────────────────────────────────────────────────────────────────┼────────────────────────┤
│ mix.copy()       │ 1. Saving to Destination │ node_modules/semantic-ui-less/themes/default/assets/fonts/**/*    │ public/fonts/semantic  │
├──────────────────┼──────────────────────────┼───────────────────────────────────────────────────────────────────┼────────────────────────┤
│ mix.styles()     │ 1. Concatenating Files   │ resources/assets/css/**/*.css                                     │ public/css/vendors.css │
│                  │ 2. Writing Source Maps   │                                                                   │                        │
│                  │ 3. Saving to Destination │                                                                   │                        │
└──────────────────┴──────────────────────────┴───────────────────────────────────────────────────────────────────┴────────────────────────┘
[22:28:08] Finished 'default' after 13 ms
Shuliyey commented 6 years ago

I made a pull request https://github.com/websemantics/strong-together/pull/3 to fix this issue

websemantics commented 6 years ago

Just merged https://github.com/websemantics/strong-together/pull/3, thanks @Shuliyey for the PR