nuxt.js build: Cannot read property 'renderRoute' of undefined - javascript

I'm using laravel-nuxt.
When i'm trying to build the project for deployment i get this error:
ERROR /about
18:54:52
TypeError: Cannot read property 'renderRoute' of undefined
at Generator.generateRoute (C:\Users\myProj\node_modules\#nuxt\generator\dist\generator.js:222:42)
at Promise.all.routes.splice.map (C:\Users\myProj\node_modules\#nuxt\generator\dist\generator.js:120:24
on all route i have in my "Pages" folder.
I have no clue on how to fix this, and I really appreciate all help I can get!
Tell me what more info you guys need to figure this one out!

I was having the same problem today and went back to nuxt 2.9.0 by changing my
package.json file like this
// "nuxt": "^2.0.0",
"nuxt": "2.9.0",
after that I hit npm install again and nuxt seems to work again

This problem is cause by #nuxt/generator.
The problem is being fixed in this pull request now: https://github.com/nuxt/nuxt.js/pull/6529
While waiting for the pull request to be reviewed, here is my work around:
"nuxt": "2.9.2",
"#nuxt/generator": "2.9.2"
And removed /node_modules and yarn install dependencies again.
Now the build works for me.

The Issue is now resolved you can update the Nuxt package
https://nuxtjs.org/guide/upgrading/

Related

Build failed because of webpack errors

I am getting below error from next js app suddenly. Any solution to fix that problem?
./pages/_app.tsx
Error: [BABEL] C:\Projects\skribeNew\app-web\pages\_app.tsx: You gave us a visitor for the node type TSSatisfiesExpression but it's not a valid type
at verify (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:397612)
at Function.explode (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:396515)
at C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1:49254
at Generator.next (<anonymous>)
at Function.<anonymous> (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1:79767)
at Generator.next (<anonymous>)
at evaluateSync (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:717268)
at Function.sync (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:715284)
at sync (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1:80263)
at sync (C:\Projects\skribeNew\app-web\node_modules\next\dist\compiled\babel\bundle.js:1910:716601)
I changed the babel types version to previous one, But it did not work.
It was because of an incompatible version issue for the npm package "#babel/plugin-transform-typescript". I fixed to the correct previous
version in package.json file. Now it's working fine. Below is the code -
"devDependencies": {
"#babel/plugin-transform-typescript": "7.19.3",
}
"resolutions": {
"#babel/plugin-transform-typescript": "7.19.3"
}
npm i --save --legacy-peer-deps
I believe I was having the same issue you are currently experiencing not too long ago. My solution came from reorganizing the path that my node files were installed. I installed my node files to a greater hierarchy in the path then created a new folder down the line to hold my project files so that the files were already somewhere in the path. Alternatively, you could try installing globally with npm install -g yarn
Hope this helps! :)

Uncaught Error: Could not find module `ember-resolver` imported from `appName/resolver'

I am using
ember-cli: 3.4.3 ,
node js:10.16.3,
ember-resolver: 5.2.1
ember-serve work perfectly and give
Build successful (25929ms) – Serving on http://localhost:4232/
but on browser console the following error comes and unable to process further
Uncaught Error: Could not find module `ember-resolver` imported from `appName/resolver'
I tried deleting package-lock.json ,node-modules, clearing cache & reinstalling still the same
Can any one help on this please
Found the issue with one dependency in package.json
"ember-light-table": "2.0.0-beta.4"
It seems this version of ember table is not compatible with other ember dependencies
reverted it to "ember-light-table": "2.0.0-beta.3",
now it is working fine
upgrade ember-source to #3.17.1 or higher

react-native metro throws error in traverseDependency, can package-lock.json be the reason?

The error I get is described here on github in detail. Basically the metro bundler fails with the following error:
error: bundling failed: TypeError: Cannot read property 'map' of undefined
at resolveDependencies (C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:370:18)
at C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:188:33
at Generator.next ()
at step (C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:298:30)
at C:\Apps\MyProject\rnw\node_modules\metro\src\DeltaBundler\traverseDependencies.js:309:15
at
DELTA [android, dev] ....../index.js ▓▓░░░░░░░░░░░░░░ 14.7% (221/612), failed.
This error message does not help me much, as I am not deep into how the metro bundler works.
So I checked recent changes I did in the code, e.g. I added the following to my project:
"react-native-tab-view": "^1.3.2",
After that, I have a weird change in package-lock.json. It seems react-native-tab-view was already existing there, I guess because it is a dependency of another project I imported before. Here is the first change in package-lock.json:
Ok so whatever, this looks still ok to me. What is weird is the second change I see:
Wait, what? A dependency to react-native-tab-view was added to react-navigation-deprecated-tab-navigator with the old version number 0.0.77? That looks strange, at least for me.
Can somebody help me out here - is this change normal, or can this be the reason why metro bundler fails?
Any input appreciated!
I solved the issue by emptying the C:\Users\\AppData\Local\Temp folder.
No Need to Empty whole folder
I solved the issue by deleting only one folder metro-cache
Path : C:\Users\Harsh1311\AppData\Local\Temp

Calling VueLoaderPlugin() causes 'findIndex' undefined error

I'm trying to integrate a Vue CLI app in another web project we are working with. The Vue app itself works when running the dev server bundled with Vue CLI.
The Vue application contains .vue files, so a loader for webpack is needed. I used the setup from the vue-loader documentation. When I ran webpack (via Grunt) I now get the following error:
Warning: Cannot read property 'findIndex' of undefined Use --force to continue.
After a lot of tinkering I figured out that the new VueLoaderPlugin(); line from the documentation mentioned above was the cause of this. However I do need this plugin to get my .vue-files to work.
I am using the following set of loaders, imported using npm via package.json:
{
// ...
"dependencies": {
//...
"webpack": "~3.9.1"
},
"devDependencies": {
// ...
"vue": "^2.5.17",
"vue-html-loader": "^1.2.4",
"vue-loader": "^15.4.2",
"vue-template-compiler": "^2.5.17"
}
}
I have tried googling for the error but came up empty handed. All help and suggestions are welcome. Cheers!
When fiddling around trying to get the vue-loader to work, at some point I got an error leading me to update webpack to a later version. This version seemed to have deprecated the use of module.loaders in favour of module.rules.
Changing this in the webpack config seems to have made everything work smoothly. Hope someone finds this useful!

Meteor, updated app and now `TypeError: check is not a function`

I am working on updating an old meteor project. It was on a very old version, older than 1.0.0. This app is experiencing this problem at Meteor 1.4.2.3. Another app is working just fine at the same version.
I've made many changes to get it to build without any errors, and it began to crash at startup with this message:
TypeError: check is not a function
at convertRegexpToMongoSelector (packages/mongo/collection.js:412:3)
at packages/mongo/collection.js:389:18
at Function._.each._.forEach (packages/underscore.js:155:22)
at Function.Mongo.Collection._rewriteSelector (packages/mongo/collection.js:386:5)
at new CursorDescription (packages/mongo/mongo_driver.js:877:36)
at OplogHandle._startTailing (packages/mongo/oplog_tailing.js:236:29)
at new OplogHandle (packages/mongo/oplog_tailing.js:76:8)
at new MongoConnection (packages/mongo/mongo_driver.js:222:25)
at new MongoInternals.RemoteCollectionDriver (packages/mongo/remote_collection_driver.js:4:16)
at Object.<anonymous> (packages/mongo/remote_collection_driver.js:38:10)
I of course tried simply adding the check package: meteor add check.
I even tried removing it and adding it again just to be sure. My .meteor/versions file contains this line: check#1.2.4
Before all of this, the app told me that my instance of mongodb was using the old mmapv1 engine and to update to the Wired Tiger one. It recommended doing this simply with a meteor reset, which I did and the message went away. I thought it might be relevant since the problem is clearly coming from inside mongo.
A New App Entirely
I decided to simply create a new app with a fresh package.json and everything, and re-add all of the packages it needed. I then copied over the relevant code from my app. I did this, and it began giving this different error:
TypeError: Cannot read property 'resolve' of undefined
at meteorInstall.node_modules.meteor.shell-server.shell-server.js (packages/shell-server/shell-server.js:403:26)
at fileEvaluate (packages/modules-runtime.js:189:9)
at Module.require (packages/modules-runtime.js:114:16)
at Module.Mp.import (/home/blaine/.meteor/packages/modules/.0.7.7.xi5f9m++os+web.browser+web.cordova/npm/node_modules/reify/lib/runtime.js:70:16)
at meteorInstall.node_modules.meteor.shell-server.main.js (packages/shell-server/main.js:1:1)
at fileEvaluate (packages/modules-runtime.js:189:9)
at require (packages/modules-runtime.js:114:16)
at /home/blaine/Business/PianoStudio/app/.meteor/local/build/programs/server/packages/shell-server.js:563:15
at /home/blaine/Business/PianoStudio/app/.meteor/local/build/programs/server/packages/shell-server.js:569:3
at /home/blaine/Business/PianoStudio/app/.meteor/local/build/programs/server/boot.js:295:34
This is once again coming from meteor released packages.
I removed the shell-server package and that message went away, but the TypeError: check is not a function returned.
I tried to remove and add the mongo package. No effect.
I tried to rebuild the app by deleting the .meteor directory and re-creating it with meteor create . No effect.
I went through and commented out every single file containing server-side code (everything not in the client directory), since it's crashing on the server and clearly not a client-side issue. No effect.
Finally I tried to downgrade my project slightly, to 1.4.1.1. No effect.
Here's my new package.json in case that's relevant:
{
"name": "app",
"private": true,
"scripts": {
"start": "meteor run"
},
"dependencies": {
"babel-runtime": "^6.18.0"
}
}
What could be hiding in my app to cause something like this? The error message is completely unhelpful,
Make sure you have check package inside your .meteor/packages file.

Categories