I cannot access https://bug.nuxtjs.org/
It does not work for me at all.
That's why I post it as-is.
I try to upgrade to the latest Nuxt
, I use https://github.com/wemake-services/wemake-vue-template
ยป npm run dev
> [email protected] dev /Users/sobolev/Documents/github/timeless_is
> cross-env NODE_ENV=development nuxt
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ โ
โ Nuxt.js v2.7.0 โ
โ Running in development mode (universal) โ
โ TypeScript support is enabled โ
โ โ
โ Listening on: http://localhost:3000/ โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โน Preparing project for development 17:45:15
โน Initial build may take a while 17:45:15
โ Builder initialized 17:45:15
ERROR The "path" argument must be of type string. Received type undefined
at validateString (internal/validators.js:125:11)
at Object.extname (path.js:1365:5)
at uniqBy_1.options.plugins.map (node_modules/@nuxt/builder/dist/builder.js:5684:58)
at Array.map (<anonymous>)
at Builder.normalizePlugins (node_modules/@nuxt/builder/dist/builder.js:5680:28)
at Builder.generateRoutesAndFiles (node_modules/@nuxt/builder/dist/builder.js:5653:36)
at Builder.build (node_modules/@nuxt/builder/dist/builder.js:5574:16)
No ideas where to look.
Resolved! Turned out there was a cache from something. Uninstalled all packages, locks, .nuxt/
folder.
Clean build is working. Thanks for the serverside logs! Awesome feature.
@sobolevn For double investigation can you please share nuxt.config
and what files are inside plugins/
dir?
The trace is referring to: https://github.com/nuxt/nuxt.js/blob/v2.7.0/packages/builder/src/builder.js#L265 (/cc @clarkdo)
@pi0 sure!
client/plugins
โโโ element-ui.ts
โโโ vee-validate.ts
โโโ vue-googlemaps.ts
โโโ vue-observe-visibility.ts
And:
// This is Nuxt configuration file
// See: https://nuxtjs.org/guide/configuration/
// We also use commonjs modules because of vue-styleguidist import system
const path = require('path')
const pkg = require('./package.json')
const envPath = path.resolve(__dirname, 'config', '.env')
require('dotenv').config({ 'path': envPath })
module.exports = {
/**
* Headers of the page
*/
'head': {
'htmlAttrs': { 'lang': 'en' },
'title': pkg.name,
'meta': [
{ 'charset': 'utf-8' },
{ 'name': 'viewport', 'content': 'width=device-width, initial-scale=1' },
{
'hid': 'description',
'name': 'description',
'content': pkg.description,
},
],
'link': [
{
'rel': 'icon',
'type': 'image/x-icon',
'href': '/favicon.ico',
}, {
'rel': 'icon',
'type': 'image/png',
'sizes': '32x32',
'href': '/favicon-32x32.png',
}, {
'rel': 'icon',
'type': 'image/png',
'sizes': '96x96',
'href': '/favicon-96x96.png',
},
],
},
/**
* Environment variables
*/
'env': {
'GOOGLE_MAPS_KEY': process.env.GOOGLE_MAPS_KEY,
},
/**
* Global router settings
*/
'router': {
// All pages require auth,
// see: https://auth.nuxtjs.org/getting-started/middleware
'middleware': ['auth'],
},
/**
* Specify Nuxt source directory
*/
'srcDir': 'client',
'rootDir': path.resolve(__dirname),
/**
* Extra Nuxt modules
*/
'modules': [
'@nuxtjs/axios',
'@nuxtjs/proxy',
'@nuxtjs/auth',
'nuxt-imagemin',
'nuxt-svg',
],
/**
* Axios settings
*/
'axios': {
// See https://axios.nuxtjs.org/options.html
'debug': process.env.NODE_ENV === 'development',
'https': process.env.NODE_ENV !== 'development',
'proxyHeadersIgnore': ['accept', 'accept-encoding', 'host'],
'progress': true,
'proxy': false,
'retry': true,
},
/**
* Proxy module for Nuxt and Axios
*/
'proxy': {},
/**
* Auth module for Nuxt,
* see: https://github.com/nuxt-community/auth-module
*/
'auth': {
'redirect': {
'login': '/',
},
'resetOnError': true,
'strategies': {
'local': {
'endpoints': {
'login': {
'url': '/api/auth/login',
'method': 'post',
'propertyName': 'token',
},
// TODO: enable logout
'logout': false,
// TODO: enable user profile
// https://github.com/nuxt-community/auth-module/issues/286
'user': false,
},
},
},
},
/**
* Custom plugins
*/
'plugins': [
'~/plugins/element-ui.ts',
'~/plugins/vue-googlemaps.ts',
'~/plugins/vee-validate.ts',
// Client-side only:
{ 'src': '~/plugins/vue-observe-visibility.ts', 'ssr': false },
],
/**
* Server side functions that we use for SSR:
* https://nuxtjs.org/api/configuration-servermiddleware/
*/
'serverMiddleware': [
'~/mock-api/server.js',
],
/**
* Global CSS
*/
'css': [
'normalize.css/normalize.css',
'~/scss/global-styles.scss',
],
/**
* postcss configuration
*/
'postcss': {},
/**
* Build configuration
*/
'build': {
'quiet': false,
extend (config, { isDev, isClient }): void {
// This line allows us to use `@import "~/scss/..."` in our app:
config.resolve.alias['/scss'] = path.resolve(__dirname, 'client', 'scss')
if (isDev && isClient) {
// Enabling eslint:
config.module.rules.push({
'enforce': 'pre',
'test': /\.(js|ts|vue)$/u,
'loader': 'eslint-loader',
'exclude': /(node_modules)/u,
})
// Enabling stylelint:
config.plugins.push(require('stylelint-webpack-plugin')({
'files': 'client/**/*.{vue,scss,css}',
}))
}
},
},
}
@pi0 Do you think if itโs related to ts-node memory cache?
@clarkdo yes, typescript can be also a reason.
It might be something from my side. I cannot reproduce it anymore.
@sobolevn ok. thanks for the clarification. closing it for now. please tell us it happened again :)
also /cc @kevinmarrec
@pi0 @sobolevn It's internal validators of path
and it isn't related to TypeScript :
So if we follow the trace back and look for nuxt builder code
It means p.src
is undefined, so it either mean :
plugins: [undefined]
or
plugins: [{ src: undefined }]
Issue is reproducible with such statements in nuxt.config.js
.
@sobolevn Dunno how it became undefined
in your case though ๐
The undefined
could be like :
User started dev server and removed one plugin, but the plugin item is deleted instead whole plugins array recreated
Also had this issue, but in my case, the problem was that I was missing an environment variable in my .env file that was added during dev process and I just didn't know that it was. So, after I added it everything returned to normal.
One way to reproduce this behavior is having a typo in plugins
section of the nuxt.config.js
:
export default {
plugins: [
[ 'see/double/brackets/here.js']
]
}
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as pending
will not be automatically marked as stale.
Most helpful comment
Also had this issue, but in my case, the problem was that I was missing an environment variable in my .env file that was added during dev process and I just didn't know that it was. So, after I added it everything returned to normal.