Closed MicroDreamIT closed 4 years ago
Can you share your nuxt.config file? My guess is that the error may be there, but not sure...
@skyrpex here is nuxt config
const laravelNuxt = require("laravel-nuxt");
module.exports = laravelNuxt({
// Options such as mode, srcDir and generate.dir are already handled for you.
modules: [],
plugins: [],
});
hmm it looks fine to me! I would ask you to upload a repository reproducing the issue. Maybe it's because a specific version of the underlying libraries.
@skyrpex I am using node v10.15.3 in windows here is git url https://github.com/MicroDreamIT/nuxtLaravel
I just installed in my Mac using yarn v1.16.0 and composer v1.8.0. After running yarn start
, Nuxt errored telling me that resources/nuxt/pages
directory is missing, which is true. You should add an empty page, like resources/nuxt/pages/index.vue
.
~/Code/nuxtLaravel master ● yarn start
yarn run v1.16.0
$ laravel-nuxt dev
[laravel] Laravel development server started: <http://127.0.0.1:8001>
[nuxt] › [HPM] Proxy created: [ '**/*', '!/__laravel_nuxt__' ] -> http://127.0.0.1:8001
[nuxt] › baseURL: /
[nuxt] › browserBaseURL: /
[nuxt] ERROR
Error: Couldn't find a `pages` directory in /Users/cristian/Code/nuxtLaravel/r esources/nuxt. Please create one under the project root
- builder.js:147 Builder.build
[nuxtLaravel]/[nuxt]/lib/builder/builder.js:147:17
- task_queues.js:89 processTicksAndRejections
internal/process/task_queues.js:89:5
I have done it before but did not work. I have created one again still dont work. Please UPDATE the project you will see. But Error in your computer is different, this is strange.
F:\temp\nuxtLaravel>npm run build
> @ build F:\temp\nuxtLaravel
> laravel-nuxt build
nuxt:build Building... +0ms
» baseURL: / nuxt:axios 19:15:36
» browserBaseURL: / nuxt:axios 19:15:36
nuxt:build App root: F:\temp\nuxtLaravel\resources\nuxt +0ms
nuxt:build Generating F:\temp\nuxtLaravel\.nuxt files... +2ms
nuxt:build Generating files... +44ms
nuxt:build Generating routes... +6ms
nuxt:build Building files... +170ms
ERROR
TypeError: Cannot read property 'compilation' of undefined
- ProgressPlugin.js:211 ProgressPlugin.apply
[nuxtLaravel]/[webpack]/lib/ProgressPlugin.js:211:19
- Tapable.js:375 Compiler.apply
[nuxtLaravel]/[nuxt]/[tapable]/lib/Tapable.js:375:16
- webpack.js:33 webpack
[nuxtLaravel]/[nuxt]/[webpack]/lib/webpack.js:33:19
- builder.js:524 compilers.compilersOptions.map.compilersOption
[nuxtLaravel]/[nuxt]/lib/builder/builder.js:524:24
- Array.map
- builder.js:523 Builder.webpackBuild
[nuxtLaravel]/[nuxt]/lib/builder/builder.js:523:39
- builder.js:168 Builder.build
[nuxtLaravel]/[nuxt]/lib/builder/builder.js:168:16
TypeError: Cannot read property 'compilation' of undefined
at ProgressPlugin.apply (F:\temp\nuxtLaravel\node_modules\webpack\lib\ProgressPlugin.js:211:19)
at Compiler.apply (F:\temp\nuxtLaravel\node_modules\nuxt\node_modules\tapable\lib\Tapable.js:375:16)
at webpack (F:\temp\nuxtLaravel\node_modules\nuxt\node_modules\webpack\lib\webpack.js:33:19)
at compilers.compilersOptions.map.compilersOption (F:\temp\nuxtLaravel\node_modules\nuxt\lib\builder\builder.js:524:24)
at Array.map (<anonymous>)
at Builder.webpackBuild (F:\temp\nuxtLaravel\node_modules\nuxt\lib\builder\builder.js:523:39)
at Builder.build (F:\temp\nuxtLaravel\node_modules\nuxt\lib\builder\builder.js:168:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ build: `laravel-nuxt build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Sharif\AppData\Roaming\npm-cache\_logs\2019-06-25T13_15_48_422Z-debug.log
I encountered this error:
~/Code/nuxtLaravel master ● yarn start
yarn run v1.16.0
$ laravel-nuxt dev
[laravel] Laravel development server started: <http://127.0.0.1:8001>
[nuxt] › [HPM] Proxy created: [ '**/*', '!/__laravel_nuxt__' ] -> http://127.0.0.1:8001
[nuxt] › baseURL: /
[nuxt] › browserBaseURL: /
[nuxt] 2019-06-25T13:23:49.495Z nuxt:build App root: /Users/cristian/Code/nuxtLaravel/resources/nuxt
[nuxt] 2019-06-25T13:23:49.495Z nuxt:build Generating /Users/cristian/Code/nuxtLaravel/.nuxt files...
[nuxt] 2019-06-25T13:23:49.506Z nuxt:build Generating files...
[nuxt] 2019-06-25T13:23:49.508Z nuxt:build Generating routes...
[nuxt] 2019-06-25T13:23:49.541Z nuxt:build Building files...
[nuxt] 2019-06-25T13:23:50.350Z nuxt:build Adding webpack middleware...
[nuxt] ERROR Failed to compile with 1 errors15:23:52
[nuxt]
[nuxt] error in ./.nuxt/client.js
[nuxt] Module build failed: TypeError: this.setDynamic is not a function
at PluginPass.pre (/Users/cristian/Code/nuxtLaravel/node_modules/babel-plugin-transform-runtime/lib/index.js:31:12)
at transformFile (/Users/cristian/Code/nuxtLaravel/node_modules/@babel/core/lib/transformation/index.js:78:27)
at runSync (/Users/cristian/Code/nuxtLaravel/node_modules/@babel/core/lib/transformation/index.js:45:3)
at runAsync (/Users/cristian/Code/nuxtLaravel/node_modules/@babel/core/lib/transformation/index.js:35:14)
at /Users/cristian/Code/nuxtLaravel/node_modules/@babel/core/lib/transform.js:34:34
at processTicksAndRejections (internal/process/task_queues.js:82:9)
@ multi webpack-hot-middleware/client?name=client&reload=true&timeout=30000&path=/__webpack_hmr ./.nuxt/client.js
[nuxt]
[nuxt] OPEN http://127.0.0.1:8000
I solved it removing the laravel-mix
dependency and installing from scratch (maybe you should remove the yarn.lock before that). I guess that the webpack versions from laravel-mix
and nuxt
are incompatible in some way. I'd suggest you to remove other dependencies like bootstrap, jquery and popper.
let me check brother
I am having this error while I run build